new form_init callback tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 08 Apr 2009 20:37:22 +0200
branchtls-sprint
changeset 1307 8c3336c5ddba
parent 1306 e70ad982374a
child 1308 3d01229d9f6a
new form_init callback
web/formfields.py
--- a/web/formfields.py	Wed Apr 08 20:36:39 2009 +0200
+++ b/web/formfields.py	Wed Apr 08 20:37:22 2009 +0200
@@ -169,7 +169,12 @@
         if self.sort:
             vocab = sorted(vocab)
         return vocab
-
+    
+    def form_init(self, form):
+        """method called before by form_build_context to trigger potential field
+        initialization requiring the form instance
+        """
+        pass
     
 class StringField(Field):
     def __init__(self, max_length=None, **kwargs):