1. simplecodes
  2. Untitled project
  3. wtforms

Commits

James Crasta  committed 1b945d5

Accept 'format' in model_form

  • Participants
  • Parent commits 212c7fc
  • Branches default

Comments (0)

Files changed (1)

File wtforms/ext/appengine/db.py

View file
     if prop.auto_now or prop.auto_now_add:
         return None
 
-    return f.DateTimeField(format='%Y-%m-%d %H:%M:%S', **kwargs)
+    kwargs.setdefault('format', '%Y-%m-%d %H:%M:%S')
+    return f.DateTimeField(**kwargs)
 
 
 def convert_DateProperty(model, prop, kwargs):
     if prop.auto_now or prop.auto_now_add:
         return None
 
-    return f.DateField(format='%Y-%m-%d', **kwargs)
+    kwargs.setdefault('format', '%Y-%m-%d')
+    return f.DateField(**kwargs)
 
 
 def convert_TimeProperty(model, prop, kwargs):
     if prop.auto_now or prop.auto_now_add:
         return None
 
-    return f.DateTimeField(format='%H:%M:%S', **kwargs)
+    kwargs.setdefault('format', '%H:%M:%S')
+    return f.DateTimeField(**kwargs)
 
 
 def convert_ListProperty(model, prop, kwargs):