mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #736 -- Changed behavior of QueryDict items() to be more consistent, fixed mutability holes, gave MultiValueDict many more dictionary methods and added unit tests. Thanks, Kieran Holland. This is slightly backwards-incompatible if you happened to rely on the behavior of QueryDict.items(), which is highly unlikely.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1504 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -57,7 +57,7 @@ class ChangeList(object):
|
||||
self.get_modules_and_options(app_label, module_name, request)
|
||||
self.get_search_parameters(request)
|
||||
self.get_ordering()
|
||||
self.query = request.GET.get(SEARCH_VAR,'')
|
||||
self.query = request.GET.get(SEARCH_VAR, '')
|
||||
self.get_lookup_params()
|
||||
self.get_results(request)
|
||||
self.title = (self.is_popup
|
||||
@@ -100,13 +100,12 @@ class ChangeList(object):
|
||||
def get_search_parameters(self, request):
|
||||
# Get search parameters from the query string.
|
||||
try:
|
||||
self.req_get = request.GET
|
||||
self.page_num = int(request.GET.get(PAGE_VAR, 0))
|
||||
except ValueError:
|
||||
self.page_num = 0
|
||||
self.show_all = request.GET.has_key(ALL_VAR)
|
||||
self.is_popup = request.GET.has_key(IS_POPUP_VAR)
|
||||
self.params = dict(request.GET.copy())
|
||||
self.params = dict((k, v) for k, v in request.GET.items())
|
||||
if self.params.has_key(PAGE_VAR):
|
||||
del self.params[PAGE_VAR]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user