web/views/formrenderers.py
changeset 2521 782360fa6cc0
parent 2520 8c5cf48ae9ea
child 2550 4e009026a0f0
equal deleted inserted replaced
2520:8c5cf48ae9ea 2521:782360fa6cc0
    83         if errormsg:
    83         if errormsg:
    84             data.insert(0, errormsg)
    84             data.insert(0, errormsg)
    85         return '\n'.join(data)
    85         return '\n'.join(data)
    86 
    86 
    87     def render_label(self, form, field):
    87     def render_label(self, form, field):
       
    88         if field.label is None:
       
    89             return u''
    88         label = self.req._(field.label)
    90         label = self.req._(field.label)
    89         attrs = {'for': form.context[field]['id']}
    91         attrs = {'for': form.context[field]['id']}
    90         if field.required:
    92         if field.required:
    91             attrs['class'] = 'required'
    93             attrs['class'] = 'required'
    92         return tags.label(label, **attrs)
    94         return tags.label(label, **attrs)