Ticket #4361: unicode-get-display.diff
File unicode-get-display.diff, 847 bytes (added by , 17 years ago) |
---|
-
db/models/base.py
12 12 from django.dispatch import dispatcher 13 13 from django.utils.datastructures import SortedDict 14 14 from django.utils.functional import curry 15 from django.utils.encoding import smart_str 15 from django.utils.encoding import smart_str, force_unicode 16 16 from django.conf import settings 17 17 from itertools import izip 18 18 import types … … 320 320 321 321 def _get_FIELD_display(self, field): 322 322 value = getattr(self, field.attname) 323 return dict(field.choices).get(value, value)323 return force_unicode(dict(field.choices).get(value, value)) 324 324 325 325 def _get_next_or_previous_by_FIELD(self, field, is_next, **kwargs): 326 326 op = is_next and '>' or '<'