You can always create your own convenience method. Atenciosamente, Vinicius Mendes Engenheiro de Computação Globo.com
On Fri, Jun 3, 2011 at 12:30 AM, Justin Holmes <jus...@justinholmes.com>wrote: > For every convenience method, there are always ways to make it even more > convenient. > > 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 <havel...@gmail.com> 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. >> >> -- >> 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. >> >> > > > -- > Justin Holmes > > Head Instructor, SlashRoot Collective > SlashRoot: Coffee House and Tech Dojo > 60 Main Street > New Paltz, NY 12561 > 845.633.8330 > > > -- > 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. > -- 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.