July 13, 2007.
After making a handful of breaking changes to my models, my old dumped data from my Django project had pretty much no intention of returning to Postgres gracefully. So I wrote a quick script that takes the datadump file and sorts out the models contained in it.
The end result is a folder named extracted that has a folder in it for each application your datadump contained. Then each application has a folder for each model it contained. Each model folder has a file (whose name is its primary key) that contains the data from a single model.
extracted -> admin -> auth -> blog -> entry -> language -> tag -> 1.xml -> 2.xml ... ... -> flatpges ...
The usage is very simple:
python model_extract.py yourdatadump.xml
This will create a folder named extracted in the folder you are currently in. It will not overwrite an existing folder (its a feature not a bug), so you'll have to remove one if it exists.
You can grab the file [here][modelextract]. You will need BeautifulSoup to use it, but you can easily install it using