On Mon, Jul 20, 2009 at 8:45 PM, Tomas Andrle<tom...@gmail.com> wrote: > > When using localized list of "choices" for a model field, the admin > doesn't show the translated values in the list view. > > Short example: > > from django.utils.translation import ugettext_lazy as _ > > class OrderStates: > STATES = ( > (STATE_NEW, _("New")), > (STATE_CANCELLED, _("Cancelled")), ) > > class Order(models.Model): > state = models.IntegerField(choices=OrderStates.STATES) > # .. > > class OrderAdmin(admin.ModelAdmin): > list_display = [ 'id', 'state', 'address', 'user'] > # .. > > admin.site.register(Order, OrderAdmin) > > The localized versions of "New" and "Cancelled" show up correctly in > the front-end and in the admin form when editing an order. > > But in the admin list view I get blank fields - regardless of the > language I switch to, including English. Column names are fine. > > This only happens with Python 2.3. The choices display correctly > everywhere with Python 2.5. I don't get any errors or warnings in > neither. > > Tried using ugettext instead of ugettext_lazy for the options, which > didn't work. ugettext_noop sort of works - it at least shows the > original english versions instead of blank fields. > > Am I doing something wrong or is this a bug? >
I haven't acceso to a system with Python 2.3 anymore so I can't do the following tests myself: Would it be possible to run your test case both under: * A checkout of Django from the 1.0.x SVN branch. * A checkout of Django from the SVN trunk. and see if there is any dfference? -- Ramiro Morales http://rmorales.net PyCon 2009 Argentina - Vie 4 y Sab 5 Septiembre Buenos Aires, Argentina http://ar.pycon.org/2009/about/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---