It would sometimes be useful to be able to write fixtures that essentially say "I don't care what the PK of this record is, as long as I have a way for other records in this fixture to refer to it."
Use case: I'd like a way to pass around useful data sets that people can load into deployments of my app. A user could choose to load any of these in any combination, possibly combined with data created by any other means, eg. the admin UI. But this means there's no safe way to know what the PKs should be - unless we use UUIDs for ids, which I'd really rather not do (uuid.uuid4().int is too big to fit into an integer id; changing all my apps to use varchar IDs would be a huge pain, and I assume would be less efficient.) (Another possible wrinkle is that each fixture file should not refer to records not contained in that fixture; I think that could reasonably fall into the category of "just don't do that". Not sure.) I found an old discussion which suggests a possible solution to explore, inspired by Rails: http://groups.google.com/group/django-users/browse_frm/thread/5fb1d260f69a2a9f/e047e049d366b3c1?lnk=gst&q=loaddata+primary#e047e049d366b3c1 ... but the thread quickly degenerated and fizzled, so I'm guessing nothing ever came of this. Anybody know otherwise? The Rails approach looks pretty sensible to me - essentially it just means supporting a variation of the fixture format, which I would think could be easily detect at load time: http://api.rubyonrails.org/classes/Fixtures.html Ideally there'd be a dumpdata option to write out PK-less fixtures, but that could come later - I think just supporting this feature in loaddata for hand-written fixtures would be useful as a first step. I have no idea yet how easy it would be to write this, just wondering at this stage if anybody had already written something to solve this problem :) - PW -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.