Ticket #4361: unicode-get-display.diff

File unicode-get-display.diff, 847 bytes (added by anonymous, 17 years ago)
  • db/models/base.py

     
    1212from django.dispatch import dispatcher
    1313from django.utils.datastructures import SortedDict
    1414from django.utils.functional import curry
    15 from django.utils.encoding import smart_str
     15from django.utils.encoding import smart_str, force_unicode
    1616from django.conf import settings
    1717from itertools import izip
    1818import types
     
    320320
    321321    def _get_FIELD_display(self, field):
    322322        value = getattr(self, field.attname)
    323         return dict(field.choices).get(value, value)
     323        return force_unicode(dict(field.choices).get(value, value))
    324324
    325325    def _get_next_or_previous_by_FIELD(self, field, is_next, **kwargs):
    326326        op = is_next and '>' or '<'
Back to Top