Snippet List
This management command is run like this: `./manage.py -a someapp filename.cfg`
it looks in `someapp`'s directory for a file called `/config/filename.cfg` with the format explained in the help text, and creates the model instances described in the config file.
It uses the configobj module.
this would be an example config file:
[project.Profile]
[[fields]]
receive_notifications = False
[[children]]
[[[auth.User]]]
[[[[fields]]]]
username = AnnonymousUser
password = ! # set unusable password. There's no way yet to hash and set a given password
email = [email protected]
- model
- instance
- object-creation
- config-file
This utility makes a text dump of a model instance, including objects related by a forward or reverse foreign key. The result is a hierarchical data structure where
* each instance is represented as a list of fields,
* each field as a (<name>, <value>) tuple,
* each <value> as a primitive type, a related object (as a list of fields), or a list of related objects.
See the docstring for examples.
We used this to make text dumps of parts of the database before and after running a batch job. The format was more useful than stock `dumpdata` output since all related data is included with each object. These dumps lend themselves particularly well for comparison with a visual diff tool like [Meld](http://meldmerge.org/).
- serialize
- dump
- model
- instance
3 snippets posted so far.