[Django] #27133: Are fixtures deprecated?

58 views
Skip to first unread message

Django

unread,
Aug 27, 2016, 2:44:41 AM8/27/16
to django-...@googlegroups.com
#27133: Are fixtures deprecated?
-------------------------------+--------------------
Reporter: xennygrimmato | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Django 1.8's documentation states that fixtures are deprecated for loading
initial data to models. However, Django 1.10 doesn't state anything about
the deprecation.
Can more clarity be given on as to how initial data should ideally be
loaded into models?

Links:
1.10: https://docs.djangoproject.com/en/1.10/howto/initial-data/
1.8: https://docs.djangoproject.com/en/1.8/howto/initial-data/

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

Django

unread,
Aug 27, 2016, 6:49:06 AM8/27/16
to django-...@googlegroups.com
#27133: Are fixtures deprecated?
-------------------------------------+-------------------------------------
Reporter: xennygrimmato | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 1.10
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 timgraham):

* component: Migrations => Documentation
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* needs_tests: => 0
* needs_better_patch: => 0


Comment:

Is the deprecation note and the explanation in the 1.7 release notes
unclear?

If an application uses migrations, there is no automatic loading of
fixtures. Since migrations will be required for applications in Django
1.9, this behavior is considered deprecated. If you want to load initial
data for an app, consider doing it in a data migration.

`initial_data` fixtures are no longer loaded for apps with migrations; if
you want to load initial data for an app, we suggest you create a
migration for your application and define a `RunPython` or `RunSQL`
operation in the operations section of the migration.

`manage.py loaddata <fixturename>` still works fine but it doesn't happen
automatically. #24778 is a ticket about possibly allowing migrations to
load fixtures.

Maybe you could propose a documentation clarification as I'm not exactly
sure what would be helpful to clarify your doubt.

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

Django

unread,
Aug 27, 2016, 6:50:40 AM8/27/16
to django-...@googlegroups.com
#27133: Explain how to load initial data with a data migration
--------------------------------------+------------------------------------
Reporter: xennygrimmato | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: Documentation | Version: 1.10
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 timgraham):

* stage: Unreviewed => Accepted


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

Django

unread,
Nov 5, 2016, 9:50:19 AM11/5/16
to django-...@googlegroups.com
#27133: Explain how to load initial data with a data migration
-------------------------------------+-------------------------------------
Reporter: Vaibhav Tulsyan | Owner: Krzysztof
Type: | Żuraw
Cleanup/optimization | Status: assigned

Component: Documentation | Version: 1.10
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 Krzysztof Żuraw):

* owner: nobody => Krzysztof Żuraw
* status: new => assigned


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

Django

unread,
Nov 5, 2016, 12:18:58 PM11/5/16
to django-...@googlegroups.com
#27133: Explain how to load initial data with a data migration
-------------------------------------+-------------------------------------
Reporter: Vaibhav Tulsyan | Owner: Krzysztof
Type: | Żuraw
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.10
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 Krzysztof Żuraw):

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


Comment:

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

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

Django

unread,
Nov 5, 2016, 4:58:54 PM11/5/16
to django-...@googlegroups.com
#27133: Explain how to load initial data with a data migration
-------------------------------------+-------------------------------------
Reporter: Vaibhav Tulsyan | Owner: Krzysztof
Type: | Żuraw
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

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

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

* stage: Ready for checkin => Accepted


Comment:

Hi, you shouldn't mark your own patch "Ready for Checkin", rather a
separate reviewer should do that.

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

Django

unread,
Nov 6, 2016, 6:06:07 AM11/6/16
to django-...@googlegroups.com
#27133: Explain how to load initial data with a data migration
-------------------------------------+-------------------------------------
Reporter: Vaibhav Tulsyan | Owner: Krzysztof
Type: | Żuraw
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.10
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 Marysia Lowas-Rzechonek):

* stage: Accepted => Ready for checkin


Comment:

Reviewed - it looks fine.

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

Django

unread,
Nov 6, 2016, 6:51:57 AM11/6/16
to django-...@googlegroups.com
#27133: Explain how to load initial data with a data migration
-------------------------------------+-------------------------------------
Reporter: Vaibhav Tulsyan | Owner: Krzysztof
Type: | Żuraw
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.10
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:"eaa6ea2f37509f2e54de5268f32469deeff89eb9" eaa6ea2f]:
{{{
#!CommitTicketReference repository=""
revision="eaa6ea2f37509f2e54de5268f32469deeff89eb9"
Fixed #27133 -- Doc'd how to provide initial data with migrations.
}}}

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

Django

unread,
Nov 6, 2016, 6:52:25 AM11/6/16
to django-...@googlegroups.com
#27133: Explain how to load initial data with a data migration
-------------------------------------+-------------------------------------
Reporter: Vaibhav Tulsyan | Owner: Krzysztof
Type: | Żuraw
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.10
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
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"07db0e068fbf5c74600acfdc7d6891df2ade7243" 07db0e0]:
{{{
#!CommitTicketReference repository=""
revision="07db0e068fbf5c74600acfdc7d6891df2ade7243"
[1.10.x] Fixed #27133 -- Doc'd how to provide initial data with
migrations.

Backport of eaa6ea2f37509f2e54de5268f32469deeff89eb9 from master
}}}

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

Reply all
Reply to author
Forward
0 new messages