Opened 19 years ago
Closed 19 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 , 19 years ago
comment:2 by , 19 years ago
I understand the patch, but I'm wondering why it was already working. Oh well! :)
comment:3 by , 19 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
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)