[Django] #26710: CreateModel.references_model should take app_label into account

12 views
Skip to first unread message

Django

unread,
Jun 5, 2016, 11:27:37 AM6/5/16
to django-...@googlegroups.com
#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.

Django

unread,
Jun 5, 2016, 11:27:52 AM6/5/16
to django-...@googlegroups.com
#26710: CreateModel.references_model should take app_label into account
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by sir-sigurd):

* owner: nobody => sir-sigurd
* needs_better_patch: => 0
* status: new => assigned
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/26710#comment:1>

Django

unread,
Jun 5, 2016, 11:35:47 AM6/5/16
to django-...@googlegroups.com
#26710: CreateModel.references_model should take app_label into account
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by sir-sigurd):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/6728 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/26710#comment:2>

Django

unread,
Jun 5, 2016, 12:05:07 PM6/5/16
to django-...@googlegroups.com
#26710: CreateModel.references_model should take app_label into account
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):

* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26710#comment:3>

Django

unread,
Jun 6, 2016, 9:45:16 AM6/6/16
to django-...@googlegroups.com
#26710: CreateModel.references_model should take app_label into account
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/26710#comment:4>

Django

unread,
Jun 6, 2016, 11:50:14 AM6/6/16
to django-...@googlegroups.com
#26710: CreateModel.references_model should take app_label into account
-------------------------------------+-------------------------------------
Reporter: sir-sigurd | Owner: sir-
Type: | sigurd
Cleanup/optimization | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"7fc4c1db627807874966e4f96b34cff7c9af886f" 7fc4c1d]:
{{{
#!CommitTicketReference repository=""
revision="7fc4c1db627807874966e4f96b34cff7c9af886f"
Fixed #26710 -- Made CreateModel.references_model() take app_label into
account.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26710#comment:5>

Reply all
Reply to author
Forward
0 new messages