no value, but something needs to be shown // needs review // tls-sprint
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Mon, 11 May 2009 19:44:52 +0200
branchtls-sprint
changeset 1735 07afba765926
parent 1734 e8673144bc74
child 1736 40190717e2de
no value, but something needs to be shown // needs review //
web/formwidgets.py
--- a/web/formwidgets.py	Mon May 11 18:02:04 2009 +0200
+++ b/web/formwidgets.py	Mon May 11 19:44:52 2009 +0200
@@ -9,7 +9,7 @@
 from datetime import date
 
 from cubicweb.common import tags
-from cubicweb.web import INTERNAL_FIELD_VALUE, stdmsgs
+from cubicweb.web import stdmsgs, INTERNAL_FIELD_VALUE
 
 
 class FieldWidget(object):
@@ -50,6 +50,8 @@
         """
         name = form.context[field]['name']
         values = form.context[field]['value']
+        if not values:
+            values = (INTERNAL_FIELD_VALUE,)
         if not isinstance(values, (tuple, list)):
             values = (values,)
         attrs = dict(self.attrs)