Re: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)

2011-02-22 Thread Ian Kelly
2011/2/22 Alexander Bolotnov > I created a simple model: > > class Menu(models.Model): > name = models.CharField(null=False, > blank=False,unique=True,max_length=50) > url = models.CharField(null=False, blank=False, > unique=True,max_length=100) > sortOrder = models.IntegerField(null=

Re: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)

2011-02-22 Thread rikuthero...@gmail.com
The problem is, I think, that you're trying to insert a non-ascii string, inside an ascii string: def __unicode__(self): return 'name: {0}, url: {1}'.format(self.name, self.url) Probably, self.name is an unicode string, and you're trying to put it on a non-unicode string. Try this: def _

Re: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)

2011-02-22 Thread Alexander Bolotnov
I fixed this by change the unicode to return self.name - but why was this failing anyway? -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this gro

'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)

2011-02-22 Thread Alexander Bolotnov
n. How do I fix this? UnicodeEncodeError at /admin/picviewer/menu/add/ 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128) Request Method:POSTRequest URL: http://127.0.0.1:8000/admin/picviewer/menu/add/Django Version:1.2.5Exception Type:UnicodeEncodeErrorEx