#5448: Primary key can't be string with unicode characters
-----------------------+----------------------------------------------------
Reporter:  pigletto    |       Owner:  nobody                
  Status:  new         |   Component:  Core framework        
 Version:  SVN         |    Keywords:  unicode primary key pk
   Stage:  Unreviewed  |   Has_patch:  0                     
-----------------------+----------------------------------------------------
 Model defined like:
 
 class Actor(models.Model):
     name = models.CharField(max_length=20, primary_key=True)
 
 when trying to save it:
 >>> travolta = Actor(name="Zażółć")
 >>> travolta.save()
 There is UnicodeDecodeError at:
 django.db.base.Model -> save function:
 
 File ".../lib/python2.4/site-packages/django/db/models/base.py", line 218,
 in save
         pk_set = pk_val is not None and pk_val != u''
     UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position
 2: ordinal not in range(128)
 
 fix should use smart_unicode like:
 pk_set = pk_val is not None and smart_unicode(pk_val) != u''

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5448>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to