web/form.py
branchstable
changeset 1860 ce67132ced1c
parent 1855 4e2eeb88780f
child 1861 21fae1546ac4
--- a/web/form.py	Tue May 19 11:01:33 2009 +0200
+++ b/web/form.py	Tue May 19 11:01:42 2009 +0200
@@ -381,6 +381,8 @@
         myattr = '%s_%s_default' % (field.role, field.name)
         if hasattr(self, myattr):
             return getattr(self, myattr)()
+        if callable(value):
+            value = value(self)
         return field.initial
 
     def form_field_error(self, field):