Ticket #13599: hide_td_containing_hidden_input_in_changelist.diff

File hide_td_containing_hidden_input_in_changelist.diff, 829 bytes (added by skevy, 14 years ago)

Hide's the td containing a hidden input in the changelist.

  • django/contrib/admin/templatetags/admin_list.py

     
    190190                result_repr = conditional_escape(result_repr)
    191191            yield mark_safe(u'<td%s>%s</td>' % (row_class, result_repr))
    192192    if form:
    193         yield mark_safe(u'<td>%s</td>' % force_unicode(form[cl.model._meta.pk.name]))
     193        if form[cl.model._meta.pk.name].is_hidden:
     194            yield mark_safe(u'<td style="display:none;">%s</td>' % force_unicode(form[cl.model._meta.pk.name]))
     195        else:
     196            yield mark_safe(u'<td>%s</td>' % force_unicode(form[cl.model._meta.pk.name]))
    194197
    195198def results(cl):
    196199    if cl.formset:
Back to Top