One of the things that bugs me about Django fixtures is that you've got to specify every model's primary key. Is there any way to create fixtures without having to specify a primary key for each row?
A:
A friend of mine suggested the fixture
module: http://farmdev.com/projects/fixture/
David Wolever
2009-10-01 15:11:16
+4
A:
Use "pk: null" instead of "pk: 1" (or whatever), which will result in the PK being set to None, and when the object is saved a primary key will be assigned.
This works for YAML at least, I'm guessing you're using that if you are creating by hand.
spookylukey
2009-10-01 16:40:23
D'oh! Of course, that makes perfect sense. Thanks.
David Wolever
2009-10-02 02:50:55