Ticket #24580: 24580.diff

File 24580.diff, 1.1 KB (added by Tim Graham, 8 years ago)
  • django/contrib/admin/templatetags/admin_list.py

    diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py
    index ce2a80c..0c6fac8 100644
    a b def items_for_result(cl, result, form):  
    237237                if isinstance(value, (datetime.date, datetime.time)):
    238238                    row_classes.append('nowrap')
    239239            else:
    240                 if isinstance(f.remote_field, models.ManyToOneRel):
    241                     field_val = getattr(result, f.name)
    242                     if field_val is None:
    243                         result_repr = empty_value_display
    244                     else:
    245                         result_repr = field_val
    246                 else:
    247                     result_repr = display_for_field(value, f, empty_value_display)
     240                result_repr = display_for_field(value, f, empty_value_display)
    248241                if isinstance(f, (models.DateField, models.TimeField, models.ForeignKey)):
    249242                    row_classes.append('nowrap')
    250243        if force_text(result_repr) == '':
Back to Top