Opened 11 years ago

Closed 11 years ago

#20558 closed New feature (fixed)

Add `response_delete` and `render_delete_form` methods to `ModelAdmin`

Reported by: anonymous Owned by: polmuz
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: polmuz Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Background:

  • It is currently quite easy to set up custom redirects after saving a new or changed object, by overriding response_add() or response_change()
  • I suggest to add a response_delete() method to ModelAdmin, called from delete_view()

Change History (7)

comment:1 by Simon Charette, 11 years ago

Easy pickings: set
Needs documentation: set
Needs tests: set
Summary: Suggestion: In ModelAdmin add a response_delete() methodAdd `response_delete` and `render_delete_form` methods to `ModelAdmin`
Triage Stage: UnreviewedAccepted
Version: 1.5master

This feature addition makes sense -- I've hit this limitation in the past.

I will mark as easy picking since it's really just code moving, simple tests and documentation writing.

Also, it might be worth adding a render_delete_form method while we're here, to be consistent with add_view (response_add/render_change_form(add=True)) and change_view (response_change, render_change_form(add=False)).

comment:2 by Sébastien Fievet, 11 years ago

Owner: changed from nobody to Sébastien Fievet
Status: newassigned

comment:3 by Sébastien Fievet, 11 years ago

As far as I've checked, there's no documentation for response_add/response_change/render_change_form. Shall we add some within this ticket?
Also, there's only one test for all the mentioned hooks, targeting only the post_url_continue parameter form response_add method. Shall we add some more?
If so, where should we put them? In tests/admin/custom_urls? Another app?
Thanks for your feedback.

comment:4 by polmuz, 11 years ago

Owner: changed from Sébastien Fievet to polmuz

Since this been quiet for a couple of months, I started to work on it. Here is the pull request: https://github.com/django/django/pull/1583

comment:5 by polmuz, 11 years ago

Has patch: set
Needs tests: unset

comment:6 by polmuz, 11 years ago

Cc: polmuz added

comment:7 by Jacob, 11 years ago

Resolution: fixed
Status: assignedclosed

Fixed in 9079436 and 73de9dd.

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