Re: widgets.py And unicode

2007-05-10 Thread Thomas Rabaix
Malcolm Tredinnick wrote: > On Thu, 2007-05-10 at 01:45 +0200, Thomas Rabaix wrote: >> Hello, >> >> I have a newform object which I prepopulate some fields : >> >> form = MenuForm() >> >> tu = () >> for m in Menu.objects.all(): >> tu += ((m.id,m),) >> form.fields['pare

Re: widgets.py And unicode

2007-05-09 Thread Malcolm Tredinnick
On Thu, 2007-05-10 at 01:45 +0200, Thomas Rabaix wrote: > Hello, > > I have a newform object which I prepopulate some fields : > > form = MenuForm() > > tu = () > for m in Menu.objects.all(): > tu += ((m.id,m),) > form.fields['parent_id'].choices = tu > > In the ca

widgets.py And unicode

2007-05-09 Thread Thomas Rabaix
Hello, I have a newform object which I prepopulate some fields : form = MenuForm() tu = () for m in Menu.objects.all(): tu += ((m.id,m),) form.fields['parent_id'].choices = tu In the case of Menu.__str__ return a utf-8 string, the SelectWidget raise an UnicodeErro