On 9/7/07, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote:
>
> Can fixtures have auto-incrementing primary keys or must you have
> specific PKs in the the serialized json/xml/etc files? If not, is
> there a reason for this?

This idea has occurred to me before, and I can see how it could be
useful, but I got caught up on one significant detail: how do you
handle references? When you specify the PK, you provide an identifier
to use as a cross reference. If this identifier no longer exists, what
do you use as a reference in its place?

> I'm programmatically generating fixtures from Freebase.org queries for
> a project. Although it's not a much extra work to add a pk counter, it
> is the second time this has struck me as annoying. Would the devs be
> open to a patch for this sort of thing?

You shouldn't even need to write a PK counter - just save the objects
without a primary key, and the database will allocate the next
available key. The issue is how to cross reference.

However, I am very much open to the general idea, as long as you can
provide a solution to the problem - and a patch would be even more
welcome.

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