~ubuntu-branches/ubuntu/quantal/python-django/quantal

« back to all changes in this revision

Viewing changes to docs/howto/initial-data.txt

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2009-07-29 11:26:28 UTC
  • mfrom: (1.1.8 upstream) (4.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090729112628-pg09ino8sz0sj21t
Tags: 1.1-1
* New upstream release.
* Merge from experimental:
  - Ship FastCGI initscript and /etc/default file in python-django's examples
    directory (Closes: #538863)
  - Drop "05_10539-sphinx06-compatibility.diff"; it has been applied
    upstream.
  - Bump Standards-Version to 3.8.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
          "first_name": "Paul",
48
48
          "last_name": "McCartney"
49
49
        }
50
 
      },
 
50
      }
51
51
    ]
52
52
 
53
53
And here's that same fixture as YAML:
65
65
        first_name: Paul
66
66
        last_name: McCartney
67
67
 
68
 
You'll store this data in a ``fixtures`` directory inside you app.
 
68
You'll store this data in a ``fixtures`` directory inside your app.
69
69
 
70
70
Loading data is easy: just call :djadmin:`manage.py loaddata fixturename
71
71
<loaddata>`, where *fixturename* is the name of the fixture file you've created.
72
72
Every time you run :djadmin:`loaddata` the data will be read from the fixture
73
73
and re-loaded into the database. Note that this means that if you change one of
74
 
the rows created by a fixture and the run :djadmin:`loaddata` again you'll wipe
75
 
out any changes you've made.
 
74
the rows created by a fixture and then run :djadmin:`loaddata` again you'll
 
75
wipe out any changes you've made.
76
76
 
77
77
Automatically loading initial data fixtures
78
78
-------------------------------------------