Lazy translation (unicode) not working for a CharField in the Admin?

12 views
Skip to first unread message

Derek

unread,
Jan 25, 2011, 8:56:26 AM1/25/11
to django-users
A new and strange error for me...

A model that has a CharField:
comment = models.CharField(max_length=100,db_column='Comment',
blank=True, null=True)
that is defined in a MySQL database:
`Comment` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,

is depicted by the Admin in both the changelist and the editing form as:
<django.utils.functional.__proxy__ object at 0x24fef10>

Other similar fields in other models do not have this "strangeness".
The docs suggest :

"Normally, you won’t have to worry about lazy translations. Just be
aware that if you examine an object and it claims to be a
django.utils.functional.__proxy__ object, it is a lazy translation.
Calling unicode() with the lazy translation as the argument will
generate a Unicode string in the current locale."

But I am not sure that this helps in the current situation (and it
also does not explain why this particular model behaves differently
from the others).

Any ideas or insights appreciated.

Derek

Reply all
Reply to author
Forward
0 new messages