Changes between Version 5 and Version 6 of Fixtures


Ignore:
Timestamp:
Aug 18, 2009, 12:37:07 AM (15 years ago)
Author:
dougireton@…
Comment:

Fixed minor spelling error

Legend:

Unmodified
Added
Removed
Modified
  • Fixtures

    v5 v6  
    4747== Fixture loading ==
    4848
    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.
     49The 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 sure that no other active application uses a fixture with the same name. If not, you can never be sure what fixtures you actually load.
    5050
    5151Therefore it is suggested that you prefix your fixtures with the application names, e.g. {{{ myapp/fixtures/myapp_testdata.json }}}.
Back to Top