#13965: psycopg2 throws an "can't adapt" error on ugettext_lazy translated
strings
-------------------------------------------+--------------------------------
Reporter: mitar | Owner: nobody
Status: new | Milestone:
Component: Internationalization | Version: 1.2
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------+--------------------------------
Comment (by mitar):
I use Django 1.2.1, psycopg2 2.2.1, Debian 5.0.5. PostgreSQL 8.3.11.
A example session in Python shell:
{{{
>>> p = models.UserProfile.objects.get(pk=7)
>>> p.city = 'foobar'
>>> p.save()
>>> from django.utils.translation import ugettext_lazy
>>> p.city = ugettext_lazy('foobar')
>>> p.save()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/pymodules/python2.5/django/db/models/base.py", line 435,
in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/usr/lib/pymodules/python2.5/django/db/models/base.py", line 501,
in save_base
rows = manager.using(using).filter(pk=pk_val)._update(values)
File "/usr/lib/pymodules/python2.5/django/db/models/query.py", line 491,
in _update
return query.get_compiler(self.db).execute_sql(None)
File "/usr/lib/pymodules/python2.5/django/db/models/sql/compiler.py",
line 861, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/usr/lib/pymodules/python2.5/django/db/models/sql/compiler.py",
line 727, in execute_sql
cursor.execute(sql, params)
File "/usr/lib/pymodules/python2.5/django/db/backends/util.py", line 15,
in execute
return self.cursor.execute(sql, params)
File
"/usr/lib/pymodules/python2.5/django/db/backends/postgresql_psycopg2/base.py",
line 44, in execute
return self.cursor.execute(query, args)
DatabaseError: can't adapt type '__proxy__'
}}}
The same happens when using a translated string for `default` value for a
field.
--
Ticket URL: <http://code.djangoproject.com/ticket/13965#comment:4>
Django <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.