#20965 closed Uncategorized (invalid)
Why do DetailView use .filter() instead of .get()?
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | Generic views | Version: | 1.5 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In django.views.generic.detail in the get_object() method it will do; queryset = queryset.filter() and I wonder why it doesn't .get()?
https://github.com/django/django/blob/master/django/views/generic/detail.py#L21
Change History (3)
comment:1 by , 11 years ago
Component: | Uncategorized → Generic views |
---|
comment:2 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
There's a
get()
call on line 52, after variousfilter()
s have been applied. This ticket tracker isn't really the place to ask these questions though, please see https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels.