Code

Opened 3 years ago

Closed 3 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:

Description

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.

Attachments (0)

Change History (2)

comment:1 Changed 3 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 3 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.