mirror of
https://github.com/django/django.git
synced 2025-06-28 06:49:12 +00:00
magic-removal: Changed get_list_or_404 to take the model class, not the magic model module
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1667 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
a56ba15f73
commit
2478533c82
@ -17,8 +17,8 @@ def get_object_or_404(klass, **kwargs):
|
|||||||
except klass.DoesNotExist:
|
except klass.DoesNotExist:
|
||||||
raise Http404
|
raise Http404
|
||||||
|
|
||||||
def get_list_or_404(mod, **kwargs):
|
def get_list_or_404(klass, **kwargs):
|
||||||
obj_list = mod.get_list(**kwargs)
|
obj_list = klass._default_manager.get_list(**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