Opened 19 years ago

Closed 18 years ago

Last modified 17 years ago

#671 closed enhancement (wontfix)

generic list_object enhancement

Reported by: ian@… 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_name
exact=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)

filter.py (1.3 KB ) - added by ian@… 19 years ago.
modifcation of hugo's IRC log filter

Download all attachments as: .zip

Change History (4)

by ian@…, 19 years ago

Attachment: filter.py added

modifcation of hugo's IRC log filter

comment:1 by ian@…, 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 hugo, 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 Adrian Holovaty, 18 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top