Re: get_object_or_404 hook

2011-06-03 Thread waylybaye
> > I think that if the needs are other than the very most typical use case > (ie, get_object_or_404) than a try block is indicated. > > On Thu, Jun 2, 2011 at 10:31 PM, waylybaye wrote: > >> Hi guys, how about add a hook to get_object_or_404 to render a >> template with

get_object_or_404 hook

2011-06-02 Thread waylybaye
Hi guys, how about add a hook to get_object_or_404 to render a template with the same name of model when object does not exist ? For example: user = get_object_or_404(User, pk=pk) if the user does not exist, get_object_or_404 will try to render "404/ user.html" to show the error page other than