[Django] #29898: Adapt schema editors to operate from model states instead of fake rendered models

22 views
Skip to first unread message

Django

unread,
Oct 28, 2018, 12:22:16 AM10/28/18
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
------------------------------------------------+------------------------
Reporter: Simon Charette | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Rendering models meant to be passed to the schema editor during the
migrate phase is the main source of slowdown during the migrate phase of a
project.

Adapting schema editors to be able to perform the same operations with
model states would be way more efficient as model rendering could always
be delayed until it's a necessity such during the application of
`RunPython` operations.

Ref #22608.

Initial work by Markus Holtermann here
https://github.com/django/django/compare/master...MarkusH:schemaeditor-
modelstate

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

Django

unread,
Nov 16, 2019, 4:16:35 AM11/16/19
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
--------------------------------------+------------------------------------

Reporter: Simon Charette | Owner: nobody
Type: Cleanup/optimization | Status: new
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 Adam (Chainz) Johnson):

* cc: Adam (Chainz) Johnson (added)


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

Django

unread,
Jun 13, 2020, 3:51:20 PM6/13/20
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
--------------------------------------+------------------------------------

Reporter: Simon Charette | Owner: nobody
Type: Cleanup/optimization | Status: new
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
--------------------------------------+------------------------------------

Comment (by Sanskar Jaiswal):

Hello everyone. This is the
[https://gist.github.com/aryan9600/b1c2eaf445006c17e02e7677cf1098d5
proposal] that I submitted for GSoC, which unfortunately wasn't accepted.
If it's fine, I would still like to work on this ticket. It would be
amazing if I could get the above mentioned proposal reviewed and was given
feedback, so that I know what to change and how to proceed.

Cheers

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

Django

unread,
May 22, 2021, 4:28:39 PM5/22/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Manav Agarwal):

* owner: nobody => Manav Agarwal
* status: new => assigned


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

Django

unread,
Jun 22, 2021, 3:57:29 AM6/22/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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

In [changeset:"d718d99017b83987fe994fab968d6c3039f352b2" d718d990]:
{{{
#!CommitTicketReference repository=""
revision="d718d99017b83987fe994fab968d6c3039f352b2"
Refs #29898 -- Moved django.db.migrations.operations.utils to
django.db.migrations.utils.
}}}

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

Django

unread,
Jun 29, 2021, 6:05:10 AM6/29/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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

In [changeset:"503ee41497f346de27843a4ea976c57303c76558" 503ee414]:
{{{
#!CommitTicketReference repository=""
revision="503ee41497f346de27843a4ea976c57303c76558"
Refs #29898 -- Moved state_forwards()'s logic from migration operations to
ProjectState.

Thanks Simon Charette and Markus Holtermann for reviews.
}}}

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

Django

unread,
Jul 20, 2021, 5:26:24 AM7/20/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by David Wobrock):

* cc: David Wobrock (added)


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

Django

unread,
Aug 11, 2021, 3:01:32 AM8/11/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton@…>):

In [changeset:"54a30a7a00fea6c5e3702282ade6e0238e06de3b" 54a30a7]:
{{{
#!CommitTicketReference repository=""
revision="54a30a7a00fea6c5e3702282ade6e0238e06de3b"
Refs #29898 -- Changed ProjectState.real_apps to set.
}}}

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

Django

unread,
Aug 20, 2021, 2:24:18 PM8/20/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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

In [changeset:"3e6a3e885336bea43bc42b8fdf8e2401970b7018" 3e6a3e88]:
{{{
#!CommitTicketReference repository=""
revision="3e6a3e885336bea43bc42b8fdf8e2401970b7018"
Refs #29898 -- Refactored out
ProjectState.resolve_model_relations()/resolve_model_field_relations()
hooks.
}}}

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

Django

unread,
Aug 24, 2021, 1:34:41 AM8/24/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

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


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

Django

unread,
Aug 25, 2021, 3:52:44 AM8/25/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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

In [changeset:"196a99da5d9c4c33a78259a58d38fb114a4d2ee8" 196a99da]:
{{{
#!CommitTicketReference repository=""
revision="196a99da5d9c4c33a78259a58d38fb114a4d2ee8"
Refs #29898 -- Made ProjectState encapsulate alterations in relations
registry.

Thanks Simon Charette and Chris Jerdonek for reviews.

Co-authored-by: Mariusz Felisiak <felisiak...@gmail.com>
}}}

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

Django

unread,
Aug 25, 2021, 3:59:36 AM8/25/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/29898#comment:11>

Django

unread,
Aug 26, 2021, 1:49:47 AM8/26/21
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: Manav
Type: | Agarwal
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: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"fa1d7ba5b9c7707cae4a23ce9876c0a7abd924a5" fa1d7ba5]:
{{{
#!CommitTicketReference repository=""
revision="fa1d7ba5b9c7707cae4a23ce9876c0a7abd924a5"
Refs #29898 -- Changed fields in ProjectState's relation registry to dict.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29898#comment:12>

Django

unread,
Mar 25, 2024, 7:50:07 AM3/25/24
to django-...@googlegroups.com
#29898: Adapt schema editors to operate from model states instead of fake rendered
models
--------------------------------------+------------------------------------
Reporter: Simon Charette | Owner: (none)
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: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: Manav Agarwal => (none)
* status: assigned => new

--
Ticket URL: <https://code.djangoproject.com/ticket/29898#comment:13>
Reply all
Reply to author
Forward
0 new messages