On 08-Oct-07, at 7:36 AM, Malcolm Tredinnick wrote:

>> name = CharField of some some length and have
>> __unicode__() = "%s"  %(self.name)
>>
>> in admin enter a finnish word with special characters like: Asikainen
>> Päivi ja Jorma. On saving, or after saving, on trying to edit the
>> word I get this error:
>
> Using this exact example and the test text you give, I cannot repeat
> this error using either [6365] or current head ([6463]) with sqlite
> (python2.3, 2.4 or 2.5), mysql or postgresql  -- python 2.5, only, in
> both cases, since I'm not set up to test other Python versions with
> those database on my laptop.

I have now managed to replicate the error using latest django svn,  
python2.5 and postgres8.x. The postgres database is unicode. The test  
models.py is given as under. In the 'name' field for sponsor, enter  
something in finnish like 'jöökeän'. Then try to enter a sponsorship.  
For me this crashes when adding a sponsorship with unicode error. (to  
get finnish non-ascii characters, set the keyboard to finnish and  
type ''' or ';' (single quote or semi-colon)

from django.db import models

# Create your models here.

class Child(models.Model):
     code = models.IntegerField(_("Child Code Number"), unique=True)
     name = models.CharField(_("Child Name"),maxlength=80)
     class Admin:
         pass
     def __unicode__(self):
         return "%s: %s" %(self.code,self.name)

class Sponsor(models.Model):
     code = models.IntegerField(_("Sponsor Code Number"), unique=True)
     name = models.CharField(_("Sponsor Name"),maxlength=80)
     class Admin:
         pass
     def __unicode__(self):
         return "%s: %s" %(self.code,self.name)

class Sponsorship(models.Model):
     """ links child to sponsor, startdate enddate and comments"""
     sponsor = models.ForeignKey(Sponsor,verbose_name=_("Sponsor"))
     child = models.ForeignKey(Child,verbose_name=_("Child"))
     class Admin:
         pass
     def __unicode__(self):
         return "%s: %s" %(self.sponsor,self.child)


-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to