Ticket #4266: admin_list_smart_str.diff

File admin_list_smart_str.diff, 951 bytes (added by Thomas Güttler <hv@…>, 18 years ago)
  • django/contrib/admin/templatetags/admin_list.py

     
    77from django.utils.html import escape
    88from django.utils.text import capfirst
    99from django.utils.translation import get_date_formats, get_partial_date_formats
     10from django.utils.encoding import smart_str
    1011from django.template import Library
    1112import datetime
    1213
     
    177178            elif f.choices:
    178179                result_repr = dict(f.choices).get(field_val, EMPTY_CHANGELIST_VALUE)
    179180            else:
    180                 result_repr = escape(str(field_val))
     181                result_repr = escape(smart_str(field_val))
    181182        if result_repr == '':
    182183            result_repr = '&nbsp;'
    183184        # If list_display_links not defined, add the link tag to the first field
Back to Top