Re: Proposal: get_or_404()

2005-09-22 Thread Simon Willison
On 22 Sep 2005, at 15:44, Adrian Holovaty wrote: def foo_detail(request, some_lookup): try: f = foos.get_object(some_field__exact=some_lookup) except foos.FooDoesNotExist: raise Http404 This is another prime candidate for a decorator: @on_not_exis

Re: Proposal: get_or_404()

2005-09-22 Thread Robert Wittams
Sounds good to me.

Re: Proposal: get_or_404()

2005-09-22 Thread Paul Bowsher
+1 here On 9/22/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > Here's a common pattern in views: > > def foo_detail(request, some_lookup): > try: > f = foos.get_object(some_field__exact=some_lookup) > except foos.FooDoesNotExist: > raise Http404 > >

Proposal: get_or_404()

2005-09-22 Thread Adrian Holovaty
Here's a common pattern in views: def foo_detail(request, some_lookup): try: f = foos.get_object(some_field__exact=some_lookup) except foos.FooDoesNotExist: raise Http404 I propose a new helper function in django.core.extensions, get_or_404(), which wo

Debugging Django

2005-09-22 Thread Andreas
I'd love to help with the Django development. If I encounter a Traceback in the admin interface, how would you recommend I start debugging? Running the webserver in Komodo's debug mode fails since multi-thread debugging is not supported. Is there a way to "simulate" a request for a page like http: