#7640: django.shortcuts.get_list_or_404 unnecessarily returns a list
---------------------------------------------+------------------------------
Reporter: Kamu | Owner: nobody
Status: closed | Milestone: 1.0
Component: Uncategorized | Version: SVN
Resolution: wontfix | Keywords:
Stage: Design decision needed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Comment (by Dagur):
The documentation needs to be fixed. get_list_or_404 is not equivalent to
doing:
def my_view(request):
my_objects = MyModel.objects.filter(published=True)
if not my_objects:
raise Http404
because that would indeed return a queryset.
--
Ticket URL: <http://code.djangoproject.com/ticket/7640#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---