I'm having some difficulty wrapping my head around Django's
fixtures and am looking for some good ground-up documentation.
Most of the documentation I've stumbled across seems to describe
fixtures as if the reader already knows all about them, where to
stash them, how to create them (either automated'ly or by-hand),
and where to stash them.

My understanding is that the initial_data fixture is _the_ way to
load, well, initial data into the DB.  I've got some CSV files
that would make this quite handy (though they'd be easy to
transform with a little sed/awk/vim into JSON or SQL "INSERT"
statements, or whatever format is easiest to understand/work-with).

I've gathered that one can create {projname}/{appname}/fixtures/
directories.  Does some sacred-named file go in this directory?
According to

http://www.djangoproject.com/documentation/django-admin/#loaddata-fixture-fixture

"each fixture has a unique name", but I'm missing the naming
conventions if there are any.  My guess would be (and given
Django's sensible design, guesses are often fairly close to being
right) that one would create files here named after one's models,
so if you had a projname.appname.models.MyModel one would create
{projname}/{appname}/fixtures/mymodel.{json,py,sql,txt,csv?} file
and populate it with the associated'ly formatted data?

I'm also somewhat confused about the interplay between fixtures
and "initial SQL":

www.djangoproject.com/documentation/model-api#providing-initial-sql-data

Is one better than the other?  Are they complementary?  Used for
different purposes? (perhaps "Initial SQL Data" for globally
initial data, and Fixtures for testing data?)

Is there some sort of _Django Fixtures for Dummies_ writeup that
I've missed?

Thanks,

-tim








--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to