diff -ru /usr/lib/python2.6/site-packages/django/forms/forms.py django/forms/forms.py
old
|
new
|
|
426 | 426 | id_ = widget.attrs.get('id') or self.auto_id |
427 | 427 | if id_: |
428 | 428 | attrs = attrs and flatatt(attrs) or '' |
429 | | contents = u'<label for="%s"%s>%s</label>' % (widget.id_for_label(id_), attrs, unicode(contents)) |
| 429 | id_for_label = widget.id_for_label(id_) |
| 430 | if id_for_label: |
| 431 | contents = u'<label for="%s"%s>%s</label>' % (id_for_label, attrs, unicode(contents)) |
| 432 | else: |
| 433 | contents = u'<label%s>%s</label>' % (attrs, unicode(contents)) |
430 | 434 | return mark_safe(contents) |
431 | 435 | |
432 | 436 | def _is_hidden(self): |