Opened 9 years ago

Closed 6 years ago

#13900 closed New feature (wontfix)

New admin feature: Delete and replace with existing object

Reported by: Riccardo Di Virgilio Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords: admin, delete_view
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes


i would like to edit django.contrib.admin.options.ModelAdmin.delete_view and add a helpful feature.

Instead of deleting all the nested objects, the delete_view could handle 3 options:

  1. delete all the related objects (current option)
  2. where the foreign key to the current instance is nullable, null or delete
  3. replace all the related objects with an other model instance (we can make a user choose it with a forms.ModelChoiceField)

i really would like to contribute to this feature, because i need to do this in my admin site, but i'm new, so please help me :)

bye bye

about me:
i'm riccardo di virgilio, i have programmed with django. i have learn a lot of things and i think i'm ready to contribute.

Change History (8)

comment:1 Changed 9 years ago by Gregor Müllegger

Component: Uncategorizeddjango.contrib.admin
Keywords: admin delete_view added
Version: 1.2SVN

Hi riccardo,

thank you for your idea - personally I find this interesting and useful. But after all its a change that needs discussion before someone invests too much time for a feature that isn't going to be integrated. So you might want to kick of a discussion in the django-developers mailing list. Go to and explain to the audience what you want todo and if they agree on its usefullness.


comment:2 Changed 9 years ago by Gregor Müllegger

Update from the mailinglist:

The idea is to provide some hooks in the ModelAdmin class that can be overwritten in subclasses to inject special behaviour for the delete view. So that no visual or semantical change is made to the delete_view by default but that its easier to provide your own logic.


comment:3 Changed 9 years ago by Yeago

This seems to essentially be a merge function. I've got something similar here although it could certainly be made easier.

comment:4 Changed 9 years ago by mariarchi

Triage Stage: UnreviewedDesign decision needed

might be useful

comment:5 Changed 8 years ago by Graham King

Severity: Normal
Type: New feature

comment:6 Changed 8 years ago by Julien Phalip

UI/UX: set

comment:7 Changed 8 years ago by Ramiro Morales

Easy pickings: unset
Summary: New admin feature: Delete and replace with existing ocjectNew admin feature: Delete and replace with existing object

comment:8 Changed 6 years ago by Aymeric Augustin

Resolution: wontfix
Status: newclosed

Since the reporter apparently lost interest after the mailing list discussion retargeted his proposal, and since there isn't a lot of demand, I'm going to close this ticket.

Feel free to reopen with a patch.

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