Opened 18 years ago

Closed 18 years ago

#2342 closed defect (fixed)

[patch] DateFieldFilterSpec small fix

Reported by: Alex Dedul Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Param 'remove' to cl.get_query_string() must be list, below is a trivial fix.

Index: django/contrib/admin/filterspecs.py
===================================================================
--- django/contrib/admin/filterspecs.py (revision 3337)
+++ django/contrib/admin/filterspecs.py (working copy)
@@ -123,7 +123,7 @@

def choices(self, cl):

for title, param_dict in self.links:

yield {'selected': self.date_params == param_dict,

  • 'query_string': cl.get_query_string(param_dict, self.field_generic),

+ 'query_string': cl.get_query_string(param_dict, [self.field_generic]),

'display': title}

FilterSpec.register(lambda f: isinstance(f, models.DateField), DateFieldFilterSpec)

Change History (3)

comment:1 by Alex Dedul, 18 years ago

Ops, here is a formatted version

Index: django/contrib/admin/filterspecs.py
===================================================================
--- django/contrib/admin/filterspecs.py (revision 3337)
+++ django/contrib/admin/filterspecs.py (working copy)
@@ -123,7 +123,7 @@
     def choices(self, cl):
         for title, param_dict in self.links:
             yield {'selected': self.date_params == param_dict,
-                   'query_string': cl.get_query_string(param_dict, self.field_generic),
+                   'query_string': cl.get_query_string(param_dict, [self.field_generic]),
                    'display': title}

 FilterSpec.register(lambda f: isinstance(f, models.DateField), DateFieldFilterSpec)

comment:2 by Adrian Holovaty, 18 years ago

I understand the patch, but I'm wondering why it was already working. Oh well! :)

comment:3 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [3403]) Fixed #2342 -- Made small fix to DateFieldFilterSpec. Thanks, Alex Dedul

Note: See TracTickets for help on using tickets.
Back to Top