Opened 14 years ago

Closed 11 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: dev
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

Description

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 sprint24.com with django. i have learn a lot of things and i think i'm ready to contribute.

Change History (8)

comment:1 by Gregor Müllegger, 14 years ago

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 http://groups.google.com/group/django-developers and explain to the audience what you want todo and if they agree on its usefullness.

Gregor

comment:2 by Gregor Müllegger, 14 years ago

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.

Discussion: http://groups.google.com/group/django-developers/browse_thread/thread/42f629f324a5177f

comment:3 by Yeago, 13 years ago

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

http://djangosnippets.org/snippets/2213/

comment:4 by mariarchi, 13 years ago

Triage Stage: UnreviewedDesign decision needed

might be useful

comment:5 by Graham King, 13 years ago

Severity: Normal
Type: New feature

comment:6 by Julien Phalip, 13 years ago

UI/UX: set

comment:7 by Ramiro Morales, 12 years ago

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

comment:8 by Aymeric Augustin, 11 years ago

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