Re-posting from Stackoverflow - I'm starting to think this is a bug...
(I'm sure you get this a lot, heh).

Django admin doesn’t show translated enumerations in list view under
Python 2.3 (Django 1.0.2)

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
- They show up correctly in the admin form when editing an order.
- In the admin list view I get blank fields instead of values -
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? Thanks.

(Posted at
http://stackoverflow.com/questions/1155079/django-admin-doesnt-show-translated-enumerations-in-list-view-under-python-2-3
got no reply)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to