Re: [Django] #15578: loaddata and processing order of fixtures

37 views
Skip to first unread message

Django

unread,
Jun 9, 2011, 2:47:17 PM6/9/11
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: lsaffre | Owner: nobody
Type: | Status: new
Cleanup/optimization | Component: Documentation
Milestone: | Severity: Normal
Version: 1.2 | Keywords:
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by trez):

* has_patch: 0 => 1
* ui_ux: => 0
* easy: => 0


Comment:

The patch attached contains this explanation:

SQL data files are executed in the same order than their ordering
in the fixtures.

For example:

fixtures = ['foo','bar','baz']
foo will be executed first then bar, then baz.

However, fixtures are not loaded for one application but for any
applications which contains this fixture.

Therefore, you should also take into account the order in which
application
are defined.

Hope this help but may surely be crystal clear with some improvements

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

Django

unread,
Jul 23, 2011, 9:48:03 AM7/23/11
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: lsaffre | Owner: nobody
Type: | Status: new
Cleanup/optimization | Component: Documentation
Milestone: | Severity: Normal
Version: 1.2 | Keywords:
Resolution: | Has patch: 1
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* needs_better_patch: 0 => 1


Comment:

There are a couple issues with this patch.

It should change the following sentences in `ref/django-admin.txt`:

- "Note that the order in which fixture files are processed is undefined."
— the section about fixtures in `topics/testing.txt` links to this
paragraph.
- "Note that the order in which the SQL files are processed is undefined."
— not sure about this one, but if the order is deterministic, let's fix it
too.

Finally, the patch isn't relative to the `trunk` directory of the source
distribution.

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

Django

unread,
Dec 8, 2015, 8:21:56 AM12/8/15
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
--------------------------------------+------------------------------------
Reporter: lsaffre | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.2
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 pakal):

I'd like to highlight another imprecise point in this documentation
paragraph : as described in (duplicate) ticket #15578, even if the order
of fixture import gets precised, users may not always rely on the "in
transaction" behaviour of loaddata, regarding relationships between
records.

Indeed DBs like MySQL do not have defered constraint checking, so
referential integrity must be true for *each* SQL operation, not just as a
whole. Others like PostgreSQL can have it on demand
(http://www.postgresql.org/docs/9.1/static/sql-set-constraints.html), but
I have alas no experience with these and the way Django uses them.

Does anybody have experience with loading interdependent fixtures on
several different engines ? Can we simply state "If your engine supports
defered constraint checking etc. etc." ?

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

Django

unread,
Nov 28, 2020, 11:04:17 AM11/28/20
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
--------------------------------------+------------------------------------
Reporter: Luc Saffre | Owner: nobody

Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.2
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 muskanvaswan):

Is this patch better framed as the following?

Fixtures are processed in the same order as the one specified in the list.
This means that if {{{Fixtures = ['foo', 'bar', 'baz']}}} then the order
in which they are loaded will be 'foo' followed by 'bar' and then 'baz'.
Where, "foo" is any fixture named 'foo' **in any application**. This
implies that in cases where there are several fixtures with the same
name, the order in which applications are defined in **INSTALLED_APPS** is
also a taken into account.
This order may not always be predictable. If the database backend supports
row-level constraints, these constraints will be checked at the end of the
transaction.

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

Django

unread,
Oct 19, 2023, 3:48:36 PM10/19/23
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: Luc Saffre | Owner: Leo
Type: | Suarez
Cleanup/optimization | Status: assigned

Component: Documentation | Version: 1.2
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 Leo Suarez):

* owner: nobody => Leo Suarez
* status: new => assigned


Comment:

Opened PR to address this item.
https://github.com/django/django/pull/17384

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

Django

unread,
Oct 19, 2023, 11:33:18 PM10/19/23
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: Luc Saffre | Owner: Leo
Type: | Suarez
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.2
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):

[https://code.djangoproject.com/ticket/15578 New PR]

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

Django

unread,
Oct 26, 2023, 8:50:28 PM10/26/23
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: Luc Saffre | Owner: Leo
Type: | Suarez
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.2
Severity: Normal | Resolution: fixed

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 Natalia <124304+nessita@…>):

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


Comment:

In [changeset:"334dc073b1d9c89692aa5b11d362fb1cceae7a4a" 334dc07]:
{{{
#!CommitTicketReference repository=""
revision="334dc073b1d9c89692aa5b11d362fb1cceae7a4a"
Fixed #15578 -- Stated the processing order of fixtures in the fixtures
docs.

Also, added details about loading multiple fixtures and unified line
wrapping
at 79 cols.

Co-Authored-By: Aniketh Babu <anike...@gmail.com>
Co-Authored-by: Mariusz Felisiak <felisiak...@gmail.com>
Co-Authored-By: Natalia Bidart <124304+...@users.noreply.github.com>
}}}

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

Django

unread,
Oct 26, 2023, 8:52:11 PM10/26/23
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: Luc Saffre | Owner: Leo
Type: | Suarez
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.2
Severity: Normal | Resolution: fixed
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 Natalia <124304+nessita@…>):

In [changeset:"89e539488a85fc08298b76215fce4b9b4cb4104b" 89e5394]:
{{{
#!CommitTicketReference repository=""
revision="89e539488a85fc08298b76215fce4b9b4cb4104b"
[5.0.x] Fixed #15578 -- Stated the processing order of fixtures in the
fixtures docs.

Also, added details about loading multiple fixtures and unified line
wrapping
at 79 cols.

Co-Authored-By: Aniketh Babu <anike...@gmail.com>
Co-Authored-by: Mariusz Felisiak <felisiak...@gmail.com>
Co-Authored-By: Natalia Bidart <124304+...@users.noreply.github.com>

Backport of 334dc073b1d9c89692aa5b11d362fb1cceae7a4a from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/15578#comment:13>

Django

unread,
Oct 26, 2023, 8:53:08 PM10/26/23
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: Luc Saffre | Owner: Leo
Type: | Suarez
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.2
Severity: Normal | Resolution: fixed
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 Natalia <124304+nessita@…>):

In [changeset:"43a36460703dfcf90dd309f0ff7306589b371e61" 43a3646]:
{{{
#!CommitTicketReference repository=""
revision="43a36460703dfcf90dd309f0ff7306589b371e61"
[4.2.x] Fixed #15578 -- Stated the processing order of fixtures in the
fixtures docs.

Also, added details about loading multiple fixtures and unified line
wrapping
at 79 cols.

Co-Authored-By: Aniketh Babu <anike...@gmail.com>
Co-Authored-by: Mariusz Felisiak <felisiak...@gmail.com>
Co-Authored-By: Natalia Bidart <124304+...@users.noreply.github.com>

Backport of 334dc073b1d9c89692aa5b11d362fb1cceae7a4a from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/15578#comment:14>

Django

unread,
Oct 30, 2023, 9:32:49 AM10/30/23
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: Luc Saffre | Owner: Leo
Type: | Suarez
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.2
Severity: Normal | Resolution: fixed
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 Natalia <124304+nessita@…>):

In [changeset:"b412e5645a65a632f0147e50ceecb60acd33bb4d" b412e564]:
{{{
#!CommitTicketReference repository=""
revision="b412e5645a65a632f0147e50ceecb60acd33bb4d"
Refs #15578 -- Made cosmetic edits to fixtures docs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/15578#comment:15>

Django

unread,
Oct 30, 2023, 9:33:30 AM10/30/23
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: Luc Saffre | Owner: Leo
Type: | Suarez
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.2
Severity: Normal | Resolution: fixed
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 Natalia <124304+nessita@…>):

In [changeset:"c8bc72462d2bc16d1287b2afa826c8da1e5fe85f" c8bc7246]:
{{{
#!CommitTicketReference repository=""
revision="c8bc72462d2bc16d1287b2afa826c8da1e5fe85f"
[5.0.x] Refs #15578 -- Made cosmetic edits to fixtures docs.

Backport of b412e5645a65a632f0147e50ceecb60acd33bb4d from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/15578#comment:16>

Django

unread,
Oct 30, 2023, 9:34:01 AM10/30/23
to django-...@googlegroups.com
#15578: loaddata and processing order of fixtures
-------------------------------------+-------------------------------------
Reporter: Luc Saffre | Owner: Leo
Type: | Suarez
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.2
Severity: Normal | Resolution: fixed
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 Natalia <124304+nessita@…>):

In [changeset:"a8aa94062b108bfca473e3263473ca926fee2f42" a8aa940]:
{{{
#!CommitTicketReference repository=""
revision="a8aa94062b108bfca473e3263473ca926fee2f42"
[4.2.x] Refs #15578 -- Made cosmetic edits to fixtures docs.

Backport of b412e5645a65a632f0147e50ceecb60acd33bb4d from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/15578#comment:17>

Reply all
Reply to author
Forward
0 new messages