google-code-export / django-modeltranslation

Automatically exported from code.google.com/p/django-modeltranslation
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

build_localized_fieldname must be a str #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

On django1.2 save a new fresh record in a registered model and it will raise a 
TypeError on the change_list view.

on utils.py build_localized_fieldname() line 31, please change 

def build_localized_fieldname(field_name, lang):
    return '%s_%s' % (field_name, lang.replace('-', '_'))

into 

def build_localized_fieldname(field_name, lang):
    return str('%s_%s' % (field_name, lang.replace('-', '_')))

Original issue reported on code.google.com by martyn.c...@gmail.com on 30 Jun 2010 at 1:18

GoogleCodeExporter commented 9 years ago
Isn't the string formatting supposed to return a string already? What type do 
you get?

Original comment by eschler on 30 Jun 2010 at 6:24

GoogleCodeExporter commented 9 years ago
I mean the only type that would make sense is a unicode object, but i'm 
wondering why it is turned into one. In any way, i gonna commit the change.

Original comment by eschler on 30 Jun 2010 at 6:50

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r79.

Original comment by eschler on 30 Jun 2010 at 7:37

GoogleCodeExporter commented 9 years ago
Ok thank you. I get a unicode with str() formating, yes.

Original comment by martyn.c...@gmail.com on 1 Jul 2010 at 8:41