[Mpuls-commits] r1608 - wasko/branches/2.0/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 16 11:39:39 CET 2010


Author: torsten
Date: 2010-02-16 11:39:36 +0100 (Tue, 16 Feb 2010)
New Revision: 1608

Modified:
   wasko/branches/2.0/mpulsweb/lib/validators.py
Log:
* mpulsweb/lib/validators.py: Expaned imports of validators.


Modified: wasko/branches/2.0/mpulsweb/lib/validators.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/validators.py	2010-02-16 10:32:41 UTC (rev 1607)
+++ wasko/branches/2.0/mpulsweb/lib/validators.py	2010-02-16 10:39:36 UTC (rev 1608)
@@ -4,6 +4,8 @@
 import datetime
 
 import formencode
+from formencode import ForEach, All
+from formencode.validators import Bool, Int, String, FieldsMatch, StringBoolean
 
 from pylons import session
 
@@ -295,8 +297,8 @@
 class NewPasswordForm(BaseFormValidator):
 
     passwd = SecurePassword()
-    passwd2 = formencode.validators.String()
-    chained_validators = [formencode.validators.FieldsMatch('passwd',
+    passwd2 = String()
+    chained_validators = [FieldsMatch('passwd',
                                                             'passwd2')]
 
 
@@ -305,24 +307,23 @@
     def __init__(self):
         formencode.api.set_stdtranslation(domain="FormEncode", languages=["de"])
 
-    firstname = formencode.validators.String(not_empty=True)
-    lastname = formencode.validators.String(not_empty=True)
-    login = formencode.All(formencode.validators.String(not_empty=True),
+    firstname = String(not_empty=True)
+    lastname = String(not_empty=True)
+    login = All(String(not_empty=True),
                            LoginCheck())
-    activated = formencode.validators.StringBoolean(if_missing=False)
-    newpass = formencode.validators.StringBoolean(if_missing=False)
+    activated = StringBoolean(if_missing=False)
+    newpass = StringBoolean(if_missing=False)
 
 
 class CreateAppointmentForm(BaseFormValidator):
 
-    start_date = formencode.All(formencode.validators.String(not_empty=True),
+    start_date = All(String(not_empty=True),
                                 DateCheck())
-    start_time = formencode.All(formencode.validators.String(not_empty=True),
+    start_time = All(String(not_empty=True),
                                 TimeCheck())
     end_date = DateCheck()
     end_time = TimeCheck()
-    title = formencode.All(formencode.validators.String(not_empty=True),
-                           StringTooLong(128))
+    title = All(String(not_empty=True), StringTooLong(128))
 
 
 class EditUserForm(NewUserForm):
@@ -337,8 +338,7 @@
 
 class EditUserGroupForm(NewUserGroupForm):
 
-    standin = formencode.ForEach(formencode.validators.Int(),
-                                 convert_to_list=True)
+    standin = ForEach(Int(), convert_to_list=True)
 
 class CreateLogbookForm(BaseFormValidator):
     date = DateCheck(not_empty=True)



More information about the Mpuls-commits mailing list