this is actually needed stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 19 May 2009 11:01:42 +0200
branchstable
changeset 1860 ce67132ced1c
parent 1859 b068abd45a1c
child 1861 21fae1546ac4
this is actually needed
web/form.py
--- 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):