﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13965	"psycopg2 throws an ""can't adapt"" error on ugettext_lazy translated strings"	Mitar	nobody	"I have a custom model field (based on a CharField) for which I am setting a default value to a string I want for it to be translated for each user based on her language settings.

So in definition of my custom field I do something like:

{{{
class CustomField(fields.CharField):
  def __init__(self, *args, **kwargs):
    ...
    kwargs.setdefault('default', ugettext_lazy('Default value'))
    ...

    super(fields.CustomField, self).__init__(*args, **kwargs)

  def get_internal_type(self):
    return ""CharField""
}}}

Sadly this fails when creating a default (empty) object with `get_or_create`. psycopg2 raises ""can't adapt"" error where it is visible that proxy object was passed as an argument."	Bug	closed	Internationalization	1.2	Normal	fixed		mmitar@… phartig@… Paul Oswald	Accepted	0	0	0	0	0	0
