should set field's choices tls-sprint
authorsylvain.thenault@logilab.fr
Thu, 30 Apr 2009 12:36:14 +0200
branchtls-sprint
changeset 1577 25b46db3cb81
parent 1576 3bfcf1e4eb26
child 1578 73af05429cb4
should set field's choices
web/formfields.py
--- a/web/formfields.py	Thu Apr 30 12:35:49 2009 +0200
+++ b/web/formfields.py	Thu Apr 30 12:36:14 2009 +0200
@@ -460,6 +460,7 @@
             for cstr in constraints:
                 if isinstance(cstr, StaticVocabularyConstraint):
                     kwargs.setdefault('widget', Select())
+                    kwargs.setdefault('choices', cstr.vocabulary)
                     if card in '?1':
                         kwargs['widget'].attrs.setdefault('size', 1)
                 if isinstance(cstr, SizeConstraint) and cstr.max is not None: