#26710: CreateModel.references_model should take app_label into account
--------------------------------------+--------------------
     Reporter:  sir-sigurd            |      Owner:  nobody
         Type:  Cleanup/optimization  |     Status:  new
    Component:  Migrations            |    Version:  master
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 `CreateModel.references_model` doesn't take `app_label` into account, this
 blocks some optimizations. For example:


 {{{
 MigrationOptimizer().optimize(
     [
         migrations.CreateModel("Foo", [("name",
 models.CharField(max_length=255))]),
         migrations.CreateModel("Bar", [("other",
 models.ForeignKey("testapp.Foo", models.CASCADE))]),
         migrations.DeleteModel("Foo"),
     ],
     app_label="otherapp"
 )
 }}}
 returns same operations, though creation and deletion of `Foo` could be
 collapsed, because this model is not referenced by `Bar`.

--
Ticket URL: <https://code.djangoproject.com/ticket/26710>
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/053.c235910d5ff130203d6f07c360e37b74%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to