1
0
mirror of https://github.com/django/django.git synced 2025-07-04 01:39:20 +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:
Malcolm Tredinnick 2007-06-09 14:44:27 +00:00
parent 322c3e1454
commit 75d29fa448

View File

@ -3,7 +3,7 @@ from django.core.exceptions import PermissionDenied
from django.utils.html import escape from django.utils.html import escape
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext, ungettext 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_' FORM_FIELD_ID_PREFIX = 'id_'
@ -171,7 +171,7 @@ class FormFieldWrapper(object):
def __unicode__(self): def __unicode__(self):
"Renders the field" "Renders the field"
return self.formfield.render(self.data) return force_unicode(self.formfield.render(self.data))
def __repr__(self): def __repr__(self):
return '<FormFieldWrapper for "%s">' % self.formfield.field_name return '<FormFieldWrapper for "%s">' % self.formfield.field_name