#34683: get_object_or_404 and get_list_or_404 custom messaging
-------------------------------------+-------------------------------------
Reporter: eavendano | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: HTTP handling | Version: 4.2
Severity: Normal | Resolution: wontfix
Keywords: HTTP 404 | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* status: new => closed
* resolution: => wontfix
Comment:
Thanks for this ticket, however we don't want to complicate this
shortcuts. You can always add a small wrapper in your app, e.g.
{{{#!python
def my_get_object_or_404(klass, message, *args, **kwargs):
try:
return get_object_or_404(klass, *args, **kwargs)
except Http404:
if message:
raise Http404(message)
else:
raise
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34683#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018905596c05-b92a3432-7c47-41bb-b184-fa2d8dc36a2a-000000%40eu-central-1.amazonses.com.