#24546: Deletion of stale content types during migrate should show cascade
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: New | Status: new
feature |
Component: Core | Version: master
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When deleting stale content-types, the migrate command says:
{{{
The following content types are stale and need to be deleted:
auth | group_permissions
Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?
If you're unsure, answer 'no'.
Type 'yes' to continue, or 'no' to cancel: yes
}}}
At this point, the user has no way to tell whether they should answer
'yes' or 'no'.
Usually they will type 'no' until they get bored, say a quick prayer and
type 'yes'.
----
Django contains infrastructure to determine how many objects will be
deleted.
{{{
>>> ct = ContentType.objects.get(app_label='auth',
model='group_permissions')
>>> collector = NestedObjects(using=DEFAULT_DB_ALIAS)
>>> collector.collect([ct])
>>> print(collector.nested())
[<ContentType: group-permission relationship>]
}}}
It would be helpful to display the list of objects that will be deleted or
at least the number of objects.
If the collector returns just the original object, perhaps migrate could
even proceed with the deletion without asking.
--
Ticket URL: <https://code.djangoproject.com/ticket/24546>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.d089d5006e0390e309825c9f24944314%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.