On Feb 8, 2008 5:11 AM, bobhaugen <[EMAIL PROTECTED]> wrote:
>
> To summarize, it is possible (altho I don't know how well-recommended)
> to dumpdata, change models, delete and recreate the database using
> syncdb, and then loaddata, without touching SQL.

This approach is database intensive if you have a lot of data, but it
will generally work. The only problem you will encounter is when you
add a new field that requires a value - you will need to manually
modify your fixture to allow for the new field.

A schema-evolution approach is the realistic long term solution. The
link Alex provided gives many alternative implementations, in varying
states of completeness. Personally, I would suggest Django Evolution
[1] - but that's mostly because I wrote it :-)

[1] http://code.google.com/p/django-evolution

> [Now I'm looking for a simpler way to dumpdata only for the model
> classes, and not for all the admin stuff in the database...something
> about default and custom managers? Searching...]

The original instructions you were following tell you how to do this -
if you provide the name of an application to dumpdata, only the data
for that application will be dumped. i.e.:

./manage.py dumpdata

will dump all the applications, including auth, contenttypes, etc

./manage.py dumpdata polls

will only dump the data for the models in the polls application.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
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