Opened 12 years ago

Closed 11 years ago

#1982 closed enhancement (wontfix)

Add a object_detail and object_list generic views that are "based" on a lookup

Reported by: EspenG Owned by: Jacob
Component: Generic views 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: UI/UX:


I was thinking, would it not be nice if there was a function like django.views.generic.list_detail.object_list that takes and argument like an id or a slug like django.views.generic.list_detail.object_detail does. An actual use of this would be when you want to show all the blog items that is marked with a spesific tag.

Change History (5)

comment:1 Changed 12 years ago by Adrian Holovaty

Summary: Generic View enhancementAdd a object_detail and object_list generic views that are "based" on a lookup

comment:2 Changed 11 years ago by James Bennett

Given that generic views all take a QuerySet as an argument, isn't this somewhat moot in the case of the list view?

comment:3 Changed 11 years ago by anonymous

I don't think you can construct the base queryset
with a 'id' you are passing in the URL itself.

eg.. show me all the invoices for customer 5.

personally I find I do a lot of these kind of views.

comment:4 Changed 11 years ago by Gary Wilson <gary.wilson@…>

Triage Stage: UnreviewedDesign decision needed

You could have your own view that calls the object_list generic view, passing it a queryset that does the filter you are wanting.

comment:5 Changed 11 years ago by James Bennett

Resolution: wontfix
Status: newclosed

This can be done extremely easily by wrapping the generic view, so I'm going to mark this wontfix.

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