Changes between Version 3 and Version 4 of Fixtures
- Timestamp:
- Aug 16, 2009, 1:41:55 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Fixtures
v3 v4 1 = = Fixtures ==1 = Fixtures = 2 2 3 3 ''It is very simple example, please, read something more complex if you need.'' … … 45 45 }}} 46 46 47 == Fixture loading == 48 49 The location where Django loads a fixture from might seem unintuitive. As with template files the fixtures off all applications in a project share the same namespace. If you follow [source:django/trunk/django/core/management/commands/loaddata.py?rev=9770#L79 loaddata.py] you see that Django searches for {{{ *appnames*/fixtures }}} and {{{ settings.FIXTURE_DIRS }}} and loads the first match. So if you use names like {{{ testdata.json }}} for your fixtures you must make sour that no other active application uses a fixture with the same name. If not, you can never be sure what fixtures you actually load. 50 51 Therefore it is suggested that you prefix your fixtures wit the application names, e.g. {{{ myapp/fixtures/myapp_testdata.json }}}. 52 53 47 54 Links: 48 55 [http://en.wikipedia.org/wiki/JSON]