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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 8 10:51:28 CET 2010


Author: torsten
Date: 2010-03-08 10:51:24 +0100 (Mon, 08 Mar 2010)
New Revision: 1905

Modified:
   wasko/branches/2.0/mpulsweb/lib/validators.py
Log:
* mpulsweb/lib/validators.py (CreateAppointmentForm),
(CreateLogbookForm): Use MaxLength-Validator instead of custom
StringTooLong - Validator 


Modified: wasko/branches/2.0/mpulsweb/lib/validators.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/validators.py	2010-03-08 09:41:07 UTC (rev 1904)
+++ wasko/branches/2.0/mpulsweb/lib/validators.py	2010-03-08 09:51:24 UTC (rev 1905)
@@ -7,7 +7,7 @@
 import formencode
 from formencode import ForEach, All
 from formencode.validators import Bool, Int, String, FieldsMatch, StringBoolean, \
-     DateConverter, DateValidator, TimeConverter, FormValidator
+     DateConverter, DateValidator, TimeConverter, FormValidator, MaxLength
 
 from pylons import session
 from pylons.i18n import _
@@ -399,7 +399,7 @@
     end_time = TimeConverter(use_datetime=True)
 
     chained_validators = [DateOrder('start_date', 'end_date')]
-    title = All(String(not_empty=True), StringTooLong(128))
+    title = All(String(not_empty=True), MaxLength(128))
 
 
 class EditUserForm(NewUserForm):
@@ -420,7 +420,7 @@
     date = DateCheck(not_empty=True)
     time = TimeCheck(not_empty=True)
     duration = Int()
-    short_notice = StringTooLong()
+    short_notice = MaxLength(80)
 
 class EditLogbookForm(CreateLogbookForm):
     pass



More information about the Mpuls-commits mailing list