Opened 4 years ago

Closed 4 years ago

#16148 closed New feature (wontfix)

get_object_or_404 hook feature

Reported by: havelove@… Owned by: nobody
Component: Core (Other) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:


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.

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

A discussion is taking place on the mailing list.

This sounds too specific for core, IMO.

comment:2 Changed 4 years ago by lukeplant

  • Resolution set to wontfix
  • Status changed from new to closed

I agree with aaugustin, closing on that basis. Thanks for the suggestion though.

Note: See TracTickets for help on using tickets.
Back to Top