Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Lazy translation (unicode) not working for a CharField in the Admin? [RSS Feed]

#1 Jan. 25, 2011 13:56:39

D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


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

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Lazy translation (unicode) not working for a CharField in the Admin? [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support