web/views/formrenderers.py
changeset 4156 1bbb0ee42c8e
parent 4083 3b285889b8e9
child 4164 119a374c5eb4
equal deleted inserted replaced
4155:80cc9c6ddcf0 4156:1bbb0ee42c8e
    95             return u''
    95             return u''
    96         if isinstance(field.label, tuple): # i.e. needs contextual translation
    96         if isinstance(field.label, tuple): # i.e. needs contextual translation
    97             label = self._cw.pgettext(*field.label)
    97             label = self._cw.pgettext(*field.label)
    98         else:
    98         else:
    99             label = self._cw._(field.label)
    99             label = self._cw._(field.label)
   100         attrs = {'for': form.context[field]['id']}
   100         attrs = {'for': field.dom_id(form)}
   101         if field.required:
   101         if field.required:
   102             attrs['class'] = 'required'
   102             attrs['class'] = 'required'
   103         return tags.label(label, **attrs)
   103         return tags.label(label, **attrs)
   104 
   104 
   105     def render_help(self, form, field):
   105     def render_help(self, form, field):