* 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.
* 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>
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>
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>
* 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>
Comment (by Mariusz Felisiak):
[https://code.djangoproject.com/ticket/15578 New PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/15578#comment:11>
* 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>
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>
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>
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>
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>
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>