Fixed #2943 -- Changed admin select filter box to work properly with multi-byte characters in verbose_name. Thanks, mtsuyuki@gmail.com

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-10-24 16:37:51 +00:00
parent b0a8a75fc3
commit 3f9ebe6cc5
1 changed files with 2 additions and 2 deletions

View File

@ -197,8 +197,8 @@ def filter_interface_script_maybe(bound_field):
f = bound_field.field f = bound_field.field
if f.rel and isinstance(f.rel, models.ManyToManyRel) and f.rel.filter_interface: if f.rel and isinstance(f.rel, models.ManyToManyRel) and f.rel.filter_interface:
return '<script type="text/javascript">addEvent(window, "load", function(e) {' \ return '<script type="text/javascript">addEvent(window, "load", function(e) {' \
' SelectFilter.init("id_%s", %r, %s, "%s"); });</script>\n' % ( ' SelectFilter.init("id_%s", "%s", %s, "%s"); });</script>\n' % (
f.name, f.verbose_name, f.rel.filter_interface-1, settings.ADMIN_MEDIA_PREFIX) f.name, f.verbose_name.replace('"', '\\"'), f.rel.filter_interface-1, settings.ADMIN_MEDIA_PREFIX)
else: else:
return '' return ''
filter_interface_script_maybe = register.simple_tag(filter_interface_script_maybe) filter_interface_script_maybe = register.simple_tag(filter_interface_script_maybe)