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
This commit is contained in:
Jacob Kaplan-Moss 2006-05-31 12:34:05 +00:00
parent 6b1e7bddc1
commit 4a57ef8588
1 changed files with 2 additions and 2 deletions

View File

@ -10,9 +10,9 @@ def render_to_response(*args, **kwargs):
return HttpResponse(loader.render_to_string(*args, **kwargs)) return HttpResponse(loader.render_to_string(*args, **kwargs))
load_and_render = render_to_response # For backwards compatibility. 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: try:
return klass._default_manager.get(**kwargs) return klass._default_manager.get(*args, **kwargs)
except klass.DoesNotExist: except klass.DoesNotExist:
raise Http404 raise Http404