get_object_or_404 hook feature
|Reported by:||havelove@…||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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 ?
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.
Change History (2)
comment:1 Changed 4 years ago by aaugustin
- Component changed from Uncategorized to Core (Other)
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Design decision needed