On Dec 26, 2007 12:47 PM, rodrigo <[EMAIL PROTECTED]> wrote:

>
> I am getting a "UnicodeEncodeError" when trying to add data containing
> accented characters (or 'ñ') via the admin interface.
> I am using the latest revision of Django via svn, and a mysql database
> with "DEFAULT CHARACTER SET utf8".
> Here's the odd part: The data does get added to the database, the
> error seems to be related to the admin interface's forms.
> In this case, I created an 'author' named : Niño Niñó. This gives me
> the error reproduced below. However, if I go into the list view for
> Authors, it shows up.If I try to modify Niño, I get a
> UnicodeEncodeError. I also get the same error if I try to create a new
> Publication (that has Author as a ManyToManyField) I also get the
> UnicodeEncodeError.
> If I delete the offending entry in the DB, the errors go away.
>
> Any help is of course appreciated,
>
> Rodrigo
>
> ------
> The error:
> [details snipped]


Does your author model have an __str__ method instead of a __unicode__
method?  That would cause the error you are reporting.  Changing it to
__unicode__ will fix the problem.

Karen

--~--~---------~--~----~------------~-------~--~----~
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