Code

Opened 4 years ago

Closed 16 months ago

#13900 closed New feature (wontfix)

New admin feature: Delete and replace with existing object

Reported by: riccardodivirgilio 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

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.

Attachments (0)

Change History (8)

comment:1 Changed 4 years ago by gregmuellegger

  • Component changed from Uncategorized to django.contrib.admin
  • Keywords admin, delete_view added
  • Version changed from 1.2 to SVN

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 Changed 4 years ago by gregmuellegger

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 Changed 4 years ago by subsume

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 Changed 4 years ago by mariarchi

  • Triage Stage changed from Unreviewed to Design decision needed

might be useful

comment:5 Changed 3 years ago by graham_king

  • Severity set to Normal
  • Type set to New feature

comment:6 Changed 3 years ago by julien

  • UI/UX set

comment:7 Changed 3 years ago by ramiro

  • Easy pickings unset
  • Summary changed from New admin feature: Delete and replace with existing ocject to New admin feature: Delete and replace with existing object

comment:8 Changed 16 months ago by aaugustin

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

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.

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.