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
Sounds good to me.
+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
>
>
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
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: