mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
unicode: Fixed #4315 -- Fixed a problem with passing unicode strings as keyword
arguments in a function call (so admin list_filters work again now). git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5270 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
abba09c6d2
commit
1ad97d0634
@ -12,7 +12,7 @@ from django.db.models.query import handle_legacy_orderlist, QuerySet
|
||||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||
from django.utils.html import escape
|
||||
from django.utils.text import capfirst, get_text_list
|
||||
from django.utils.encoding import smart_unicode
|
||||
from django.utils.encoding import smart_unicode, smart_str
|
||||
from django.utils.translation import ugettext as _
|
||||
import operator
|
||||
|
||||
@ -686,6 +686,12 @@ class ChangeList(object):
|
||||
for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR):
|
||||
if i in lookup_params:
|
||||
del lookup_params[i]
|
||||
for key, value in lookup_params.items():
|
||||
if not isinstance(key, str):
|
||||
# 'key' will be used as a keyword argument later, so Python
|
||||
# requires it to be a string.
|
||||
del lookup_params[key]
|
||||
lookup_params[smart_str(key)] = value
|
||||
|
||||
# Apply lookup parameters from the query string.
|
||||
qs = qs.filter(**lookup_params)
|
||||
|
Loading…
x
Reference in New Issue
Block a user