web/formwidgets.py
branchstable
changeset 2091 a7ea618e5478
parent 1989 8c8dead642f7
child 2131 00e6d1cb18ea
--- a/web/formwidgets.py	Wed Jun 10 12:50:05 2009 +0200
+++ b/web/formwidgets.py	Wed Jun 10 14:51:48 2009 +0200
@@ -22,6 +22,8 @@
     # automatically set id and tabindex attributes ?
     setdomid = True
     settabindex = True
+    # does this widget expect a vocabulary
+    vocabulary_widget = False
 
     def __init__(self, attrs=None, setdomid=None, settabindex=None):
         if attrs is None:
@@ -171,6 +173,8 @@
 
 class Select(FieldWidget):
     """<select>, for field having a specific vocabulary"""
+    vocabulary_widget = True
+
     def __init__(self, attrs=None, multiple=False):
         super(Select, self).__init__(attrs)
         self._multiple = multiple
@@ -203,6 +207,7 @@
     input will be generated for each possible value.
     """
     type = 'checkbox'
+    vocabulary_widget = True
 
     def render(self, form, field):
         name, curvalues, attrs = self._render_attrs(form, field)