#24067: Renaming models prompts for content type deletions
-----------------------------+------------------------------------
     Reporter:  doepunk      |                    Owner:  nobody
         Type:  New feature  |                   Status:  new
    Component:  Migrations   |                  Version:  1.7
     Severity:  Normal       |               Resolution:
     Keywords:               |             Triage Stage:  Accepted
    Has patch:  0            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+------------------------------------
Changes (by charettes):

 * cc: charettes (added)


Comment:

 IMO the content types should be automatically updated upon `RenameModel`
 operations.

 Unfortunately there's no way for the
 `django.contrib.contenttypes.management.update_contenttypes` receiver to
 differentiate between model renaming, addition and deletion hence the
 current prompt.

 Would it make sense to dispatch the plan via `post_migrate` to allow
 receivers to deal with applied migrations? In the case of the `flush`
 command plan would be `None`.

 Given this plan, `update_contenttypes` could automatically update the
 `ContentType.model` by following the `RenameModel` chain.

 By the way I find it a bit odd that we document that `post_migrate`
 receivers should always perform database operation when
 `update_contenttypes` is.

--
Ticket URL: <https://code.djangoproject.com/ticket/24067#comment:4>
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/065.9afd6fbabab3ecdd67f9606675f43433%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to