#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       
 Keywords:                        |       Stage:  Unreviewed
Has_patch:  0                     |  
----------------------------------+-----------------------------------------
 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.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13965>
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.

Reply via email to