Ticket #2301: list_display_links.th.patch
File list_display_links.th.patch, 1.3 KB (added by , 18 years ago) |
---|
-
django/contrib/admin/templatetags/admin_list.py
167 167 result_repr = ' ' 168 168 # If list_display_links not defined, add the link tag to the first field 169 169 if (first and not cl.lookup_opts.admin.list_display_links) or field_name in cl.lookup_opts.admin.list_display_links: 170 table_tag = {True:'th', False:'td'}[first] 170 171 first = False 171 172 url = cl.url_for_result(result) 172 173 result_id = str(getattr(result, pk)) # str() is needed in case of 23L (long ints) 173 yield ('< th%s><a href="%s"%s>%s</a></th>' % \174 ( row_class, url, (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, %r); return false;"' % result_id or ''), result_repr))174 yield ('<%s%s><a href="%s"%s>%s</a></%s>' % \ 175 (table_tag, row_class, url, (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, %r); return false;"' % result_id or ''), result_repr, table_tag)) 175 176 else: 176 177 yield ('<td%s>%s</td>' % (row_class, result_repr)) 177 178