#671 closed enhancement (wontfix)
generic list_object enhancement
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I would like the generic list_object view to be able to take query parameters to filter out the object_list.
ie something like (for the polls app)
?poll_namecontains=foo
or
?poll_nameexact=blah
now I understand I can subclass the view and do this..
but I thought it would be nice to have in the default generic view as it will make prototyping SO much faster for me.
Attachments (1)
Change History (4)
by , 19 years ago
comment:1 by , 19 years ago
the attachment is a wrapper which will take the query args passed by the browser and apply them to as 'extra keywords' IF the field name exist.
props to hugo for the general code.
comment:2 by , 19 years ago
#667 would make this much easier in that you can just register a callback for extra_lookup_kwargs that get's the request and the url-based kwargs for the viewfunction and returns a dictionary of key/value pairs to merge into the lookup keyword parameters. That way your callback can look at the GET variables and modify the selection accordingly.
comment:3 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
modifcation of hugo's IRC log filter