]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
Added state parameter to to_python and from_python methods to avoid an error when
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sat, 30 Oct 2010 19:35:15 +0000 (19:35 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sat, 30 Oct 2010 19:35:15 +0000 (19:35 +0000)
the DateTimeNoSec validator is used in controllers/bericht.py

git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/trunk/wradmin@618 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wradmin/wradmin/model/validators.py

index 4a30db337711d2ed0ff0b3bcd220303d8b0bfa38..4550da0dcae5376c16b51a968ea454554d141281 100644 (file)
@@ -259,12 +259,12 @@ class GenericDateTime(formencode.FancyValidator):
         formencode.FancyValidator.__init__(self, **keywords)
         self.date_time_format = date_time_format
     
-    def to_python(self, value):
+    def to_python(self, value, state=None):
         self.assert_string(value, None)
         try: return datetime.datetime.strptime(value, self.date_time_format)
         except ValueError, e: raise formencode.Invalid(str(e), value, None)
     
-    def from_python(self, value):
+    def from_python(self, value, state=None):
         return value.strftime(self.date_time_format)