Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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 anonymous, 11 years ago

Component: UncategorizedGeneric views

comment:2 by Tim Graham, 11 years ago

Resolution: invalid
Status: newclosed

There's a get() call on line 52, after various filter()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.

comment:3 by anonymous, 11 years ago

I see, I'm so sorry for that.

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