I had an annoying problem in my Django app when I translated it to Hebrew, & started adding Hebrew data. It would yell the regular ‘ascii can’t decode non-ascii characters’ error page. I dug a bit inside the admin code but didn’t see something wrong or fixable.
So today I finally understood I need to change the __str__ method to __unicode__ . This solved the problem completely. Too bad it doesn’t appear in the Django documentation nowhere. I would expect it in the Internationalization page & the tutorials too!
October 18, 2007 at 9:30 pm
Yeah, we need to do a better job talking about __unicode__ in the right places.
There’s a bunch of documentation about unicode data in Django at http://www.djangoproject.com/documentation/unicode/, but it’s currently not well integrated into the rest of the docs.
Where else besides i18n and tutorials would you expect to find that info?
October 18, 2007 at 9:52 pm
Thanks for answering Jacob!
I expect it to be in any page returned by Google in queries for Django + any of the terms in this error. Perhaps you can put some kind of knowledge-base for common errors.
Searching for it now, I see the Unicode page & also that the Tutorial now mentions it, which I hope will be helpful for ppl encountering this.
It just wasted me so much time, I had to put it online for their sake.
Thanks BTW for your beautiful & empowering framework!
November 26, 2007 at 12:14 am
Thank you dibau,
I did come across it when I had gone through either the djangobook (I can’t help thinking about this name as a tribute to Rudyiard Kipling) or the djangoproject documentation, but you were quite clear about the subject.
Cheers
My thanks also to Jacob Kaplan-Moss (Jacob, the link you provided is dead).