Code

Ticket #15578: doc_patch.diff

File doc_patch.diff, 1.0 KB (added by trez, 3 years ago)

doc path for fixture ordering - maybe just a draft

Line 
1Index: initial-data.txt
2===================================================================
3--- initial-data.txt    (révision 16341)
4+++ initial-data.txt    (copie de travail)
5@@ -116,11 +116,21 @@
6 </ref/django-admin>`. Refer to the :doc:`manage.py documentation
7 </ref/django-admin>` for more information.
8 
9-Note that if you have multiple SQL data files, there's no guarantee of
10-the order in which they're executed. The only thing you can assume is
11-that, by the time your custom data files are executed, all the
12-database tables already will have been created.
13+SQL data files are executed in the same order than their ordering
14+in the fixtures.
15 
16+For example:
17+
18+fixtures = ['foo','bar','baz']
19+foo will be executed first then bar, then baz.
20+
21+However, fixtures are not loaded for one application but for any
22+applications which contains this fixture.
23+
24+Therefore, you should also take into account the order in which application
25+are defined.
26+
27+
28 .. admonition:: Initial SQL data and testing
29 
30     This technique *cannot* be used to provide initial data for