mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
Added *args to get_list_or_404, too (refs #2048).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3015 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4a57ef8588
commit
eb74800b31
@ -16,8 +16,8 @@ def get_object_or_404(klass, *args, **kwargs):
|
|||||||
except klass.DoesNotExist:
|
except klass.DoesNotExist:
|
||||||
raise Http404
|
raise Http404
|
||||||
|
|
||||||
def get_list_or_404(klass, **kwargs):
|
def get_list_or_404(klass, *args, **kwargs):
|
||||||
obj_list = list(klass._default_manager.filter(**kwargs))
|
obj_list = list(klass._default_manager.filter(*args, **kwargs))
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
raise Http404
|
raise Http404
|
||||||
return obj_list
|
return obj_list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user