Opened 19 years ago

Closed 18 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: no UI/UX: no

Description

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 by Adrian Holovaty, 19 years ago

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

comment:2 by James Bennett, 18 years ago

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 by anonymous, 18 years ago

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 by Gary Wilson <gary.wilson@…>, 18 years ago

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 by James Bennett, 18 years ago

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