web/formrenderers.py
branchtls-sprint
changeset 1601 171afa270086
parent 1576 3bfcf1e4eb26
child 1628 888871a071d9
equal deleted inserted replaced
1579:4eea314694e2 1601:171afa270086
    13 
    13 
    14 from cubicweb.common import tags
    14 from cubicweb.common import tags
    15 from cubicweb.web import eid_param
    15 from cubicweb.web import eid_param
    16 from cubicweb.web import formwidgets as fwdgs
    16 from cubicweb.web import formwidgets as fwdgs
    17 from cubicweb.web.widgets import checkbox
    17 from cubicweb.web.widgets import checkbox
       
    18 from cubicweb.web.formfields import HiddenInitialValueField
    18 
    19 
    19 
    20 
    20 class FormRenderer(object):
    21 class FormRenderer(object):
    21     """basic renderer displaying fields in a two columns table label | value
    22     """basic renderer displaying fields in a two columns table label | value
    22 
    23 
   143         if form.cwtarget:
   144         if form.cwtarget:
   144             tag += ' cubicweb:target="%s"' % html_escape(form.cwtarget)
   145             tag += ' cubicweb:target="%s"' % html_escape(form.cwtarget)
   145         return tag + '>'
   146         return tag + '>'
   146 
   147 
   147     def display_field(self, form, field):
   148     def display_field(self, form, field):
       
   149         if isinstance(field, HiddenInitialValueField):
       
   150             field = field.visible_field
   148         return (self.display_fields is None
   151         return (self.display_fields is None
   149                 or (field.name, field.role) in self.display_fields
   152                 or (field.name, field.role) in self.display_fields
   150                 or (field.name, field.role) in form.internal_fields)
   153                 or (field.name, field.role) in form.internal_fields)
   151 
   154 
   152     def render_fields(self, w, form, values):
   155     def render_fields(self, w, form, values):