On 11/30/06, Honza Král <[EMAIL PROTECTED]> wrote:
> great work on those forms, I really like them, thanks.
> I am currently using them for a few projects and am delighted with them.
>
> I am also facing some UNICODE issues, when saving into a database
> (postgres), the backend fails to quote the values from the form
> correctly (field is a charfield):
>
> when I do
> model.field = form.clean()['form_field']
> model.save()
>
> I get a ProgrammingError, the SQL command is missing quotes around the
> value in question. I worked around this using str(
> form.clean()['form_field'] ), but that doesn't strike me as very nice.
Hi Honza,
Glad you like the newforms package! Yes, the Postgres database backend
does not quote Unicode strings properly, so for the moment you'll have
to do what you're doing -- or use
form.clean()['form_field'].encode('utf8') to be a bit safer.
We should fix the Postgres database backend so that it encodes Unicode
strings into bytestrings before inserting them into a statement --
I'll put that on the to-do list.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---