mirror of
https://github.com/django/django.git
synced 2025-07-03 17:29:12 +00:00
unicode: Fixed #4493 -- Fixed a problem where a __unicode__ method was not
returning a unicode object. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5447 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
322c3e1454
commit
75d29fa448
@ -3,7 +3,7 @@ from django.core.exceptions import PermissionDenied
|
||||
from django.utils.html import escape
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext, ungettext
|
||||
from django.utils.encoding import smart_unicode, smart_str
|
||||
from django.utils.encoding import smart_unicode, force_unicode, smart_str
|
||||
|
||||
FORM_FIELD_ID_PREFIX = 'id_'
|
||||
|
||||
@ -171,7 +171,7 @@ class FormFieldWrapper(object):
|
||||
|
||||
def __unicode__(self):
|
||||
"Renders the field"
|
||||
return self.formfield.render(self.data)
|
||||
return force_unicode(self.formfield.render(self.data))
|
||||
|
||||
def __repr__(self):
|
||||
return '<FormFieldWrapper for "%s">' % self.formfield.field_name
|
||||
|
Loading…
x
Reference in New Issue
Block a user