[Django] #33216: Use simplified paths for deconstruct of expressions

19 views
Skip to first unread message

Django

unread,
Oct 21, 2021, 6:31:13 AM10/21/21
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
------------------------------------------------+------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Previously `F()` deconstructed to: `django.db.models.expressions.F()`. But
since it can also be imported from `django.db.models`,
[https://github.com/django/django/pull/14047 PR #14047] changed it to
deconstruct to `django.db.models.F()`. This simplifies generated migration
code where it will be referenced only as `from django.db import models /
models.F()`.

As Mariusz pointed out on the PR, the same technique can be applied to
other expressions, further simplifying generated migrations.

--
Ticket URL: <https://code.djangoproject.com/ticket/33216>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 21, 2021, 6:50:20 AM10/21/21
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
--------------------------------------+------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

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


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

Django

unread,
Oct 22, 2021, 12:00:58 PM10/22/21
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Manaia
Type: | Junior
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Manaia Junior):

* owner: nobody => Manaia Junior
* status: new => assigned


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

Django

unread,
Dec 2, 2021, 3:36:34 AM12/2/21
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Manaia
Type: | Junior
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by AllenJonathan):

I would like to give this a try if someone can guide me on how to proceed
with this problem.

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

Django

unread,
Dec 2, 2021, 9:11:55 AM12/2/21
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Manaia
Type: | Junior
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Adam Johnson):

I don't think much more guidance can be given particular to this ticket.
Did you see the example PR? Have you read the contributing guidelines and
the first patch tutorial?

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

Django

unread,
Dec 6, 2021, 8:49:51 AM12/6/21
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner:
Type: | AllenJonathan
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by AllenJonathan):

* owner: Manaia Junior => AllenJonathan


Comment:

I have deconstructed Value() and submitted a pull request
https://github.com/django/django/pull/15161. I'm not sure if I did the
right thing because other expressions' path could be simplified as well
but I haven't figured those out.

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

Django

unread,
Dec 21, 2021, 11:07:59 PM12/21/21
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner:
Type: | AllenJonathan
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by AllenJonathan):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33216#comment:6>

Django

unread,
Dec 27, 2021, 4:22:34 AM12/27/21
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner:
Type: | AllenJonathan
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33216#comment:7>

Django

unread,
Jan 4, 2022, 2:11:18 PM1/4/22
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner:
Type: | AllenJonathan
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"205f67cd5bea242fac6b0380fa26570505d07dcb" 205f67c]:
{{{
#!CommitTicketReference repository=""
revision="205f67cd5bea242fac6b0380fa26570505d07dcb"
Refs #33216 -- Made @deconstructible do not change path for subclasses.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33216#comment:8>

Django

unread,
Jan 7, 2022, 5:29:37 AM1/7/22
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner:
Type: | AllenJonathan
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/33216#comment:9>

Django

unread,
Jan 7, 2022, 6:23:00 AM1/7/22
to django-...@googlegroups.com
#33216: Use simplified paths for deconstruct of expressions
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner:
Type: | AllenJonathan
Cleanup/optimization | Status: closed
Component: Migrations | Version: dev
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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"28c98d41133802e4ddcf9d1994b93c69a802fc7a" 28c98d41]:
{{{
#!CommitTicketReference repository=""
revision="28c98d41133802e4ddcf9d1994b93c69a802fc7a"
Fixed #33216 -- Simpilified deconstructed paths for some expressions.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33216#comment:10>

Reply all
Reply to author
Forward
0 new messages