On 03/06/11 03:31, waylybaye wrote:
> 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 a single 404 page for all
> queries.
> It's very useful I think.

I'm sure it is useful, but it's too adhoc and specific to your
requirements to be included in Django itself. Something for
djangosnippets.org, probably.

Thanks,

Luke

-- 
"Underachievement: The tallest blade of grass is the first to be
cut by the lawnmower." (despair.com)

Luke Plant || http://lukeplant.me.uk/

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to