Re: Problem with Django 1.0 admin on Russian language

2008-09-19 Thread Fedya
Everybody, thank you for feedback. Karen, you were absolutely right! I've changed collation to utf8_unicode_ci and Django is converting strings to unicode! This is fine! Thanks a lot! RTFM :-) On Sep 18, 6:12 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Since you say you are using UTF8_BIN c

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Karen Tracey
Since you say you are using UTF8_BIN collation on MySQL, be sure to read: http://docs.djangoproject.com/en/dev/ref/databases/#collation-settings When you specify a binary collation in MySQL, your application code has to take on the responsibility of transforming bytestrings returned by the databa

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Grigory Fateyev
Hello Fedya! On Thu, 18 Sep 2008 07:24:16 -0700 (PDT) you wrote: > > Unfortunately I'm dummy in python... so it's twice harder to find the > reason... But I'm still trying :) Maybe this helps? # grep -i utf8 /usr/lib/python2.4/site.py encoding = "utf8" # Default value set by _PyUnicode_In

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Fedya
Unfortunately I'm dummy in python... so it's twice harder to find the reason... But I'm still trying :) I wrote very simple view: def main_menu(request): html = '' menu = Item.root('main').children() for s in menu[0].title: html = '%s %s' % (html, ord(s)) html = '%s%s' %

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Fedya
Still something wrong with character set. When I use Russian characters inside value of a field in one table, Django admin interface can't show list of object corresponding to that table. Like I'm trying to access http://test.legalsw.ru/admin/menu/item/ and getting: TemplateSyntaxError at /admin/

Re: Problem with Django 1.0 admin on Russian language

2008-09-18 Thread Fedya
hm... I've tried with very simple model from the scratch and I got the same problem without init_command... On Sep 18, 2:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-09-18 at 01:57 +0300, Fedor Tyurin wrote: > > Another possible solution (and probably better one) is to use

Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Malcolm Tredinnick
On Thu, 2008-09-18 at 01:57 +0300, Fedor Tyurin wrote: > Another possible solution (and probably better one) is to use > init_command option set to 'SET NAMES utf8'. Django and MySQLdb already do this by default. Django passes the "charset='utf-8'" parameter to the connection and MySQLdb turns t

Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedor Tyurin
Another possible solution (and probably better one) is to use init_command option set to 'SET NAMES utf8'. 2008/9/18 Fedor Tyurin <[EMAIL PROTECTED]> > I set default-character-set to cp1251 (default server encoding) and now > admin seems to work correctly > > 2008/9/18 Fedor Tyurin <[EMAIL PROTEC

Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedor Tyurin
I set default-character-set to cp1251 (default server encoding) and now admin seems to work correctly 2008/9/18 Fedor Tyurin <[EMAIL PROTECTED]> > It seems to be related with database connection properties. I've tried with > sqlite3 and problem disappeared. > > If I run mysql console and request

Re: Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedor Tyurin
It seems to be related with database connection properties. I've tried with sqlite3 and problem disappeared. If I run mysql console and request status (\s command) mysql response the following information about character set: Server characterset:cp1251 Db characterset:utf8 Client chara

Problem with Django 1.0 admin on Russian language

2008-09-17 Thread Fedya
Hi everybody, I'm trying to port my site to Django 1.0... And it works fine if LANGUAGE_CODE is set to en-us, but if I set it to ru the following problem appears while I'm trying add new object using admin interface: Warning at /admin/storage/file/add/ Data truncated for column 'message' at row