From 4a57ef858870faaadfcbc30cd8af4520fe7c9d51 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 31 May 2006 12:34:05 +0000 Subject: [PATCH] Fixed #2048 - get_object_or_404 now allows *args as well. Thanks, Joeboy git-svn-id: http://code.djangoproject.com/svn/django/trunk@3014 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/shortcuts/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/shortcuts/__init__.py b/django/shortcuts/__init__.py index b42ede0339..37de0f9482 100644 --- a/django/shortcuts/__init__.py +++ b/django/shortcuts/__init__.py @@ -10,9 +10,9 @@ def render_to_response(*args, **kwargs): return HttpResponse(loader.render_to_string(*args, **kwargs)) load_and_render = render_to_response # For backwards compatibility. -def get_object_or_404(klass, **kwargs): +def get_object_or_404(klass, *args, **kwargs): try: - return klass._default_manager.get(**kwargs) + return klass._default_manager.get(*args, **kwargs) except klass.DoesNotExist: raise Http404