﻿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
4320	unicode-branch - admin select view doesn't work for localized field with choices	anonymous	Malcolm Tredinnick	"I have this simple model:

{{{
from django.db import models
from django.utils.translation import ugettext_lazy as _

class MyModel(models.Model):
    my_field = models.CharField(choices=(('a', _('a')), ('b', _('b'))), maxlength=1)

    class Admin:
       list_display = ['my_field']
}}}

TypeError is thrown:

{{{
TypeError at /admin/my_app/mymodel/
unicode.__cmp__(x,y) requires y to be a 'unicode', not a 'str'
Request Method: GET
Request URL: http://hradec:8003/admin/my_app/mymodel/
Exception Type: TypeError
Exception Value: unicode.__cmp__(x,y) requires y to be a 'unicode', not a 'str'
Exception Location: /usr/local/lib/python2.4/site-packages/django/contrib/admin/templatetags/admin_list.py in items_for_result, line 184
}}}

This problem can be solved by the attached patch.
"		closed	Internationalization	other branch		fixed	unicode-branch, admin		Accepted	1	0	0	0	0	0
