Hi Greg,
Apologies for not responding sooner, even if just to let you know that
you're not howling at the moon. I'm not ignoring you - I just don't
have anything to add at this point.
Yes, there is some work required on serialization to support some of
the additions to QS-RF. Inherited models are one problematic area;
models with non-primary OneToOneFields are another (although the
problems are probably related). As soon as I've finished this email,
I'm going to take a look at these problems and see what I can do about
a fix.
Yours,
Russ Magee %-)
I think I have it pretty much under control. I'm just finessing some
test cases at the moment. It turns out there are actually a couple of
related problems - too much data was being serialized, primary keys
were missing a few critical annotations, and the save process was a
little too enthusiastic about creating new parent instances. However,
I think I've got a solution now; a little more testing, and there
should be something in trunk. Watch this space. :-)
Yours,
Russ Magee %-)
OK; committed as [7600]. Let me know if you continue to have
difficulties with this.
Yours,
Russ Magee %-)
I've just added some docs about this [1]. You will need to dump both
parent class and child class. If they're in separate applications,
that means dumping both applications (or parts of both applications,
as appropriate).
When fixtures are reloaded, all the fixtures you load in a single
loaddata command are loaded inside a single transaction. Referential
integrity (when it's supported by your database) isn't checked until
the end of the transaction, so the order of creation internal to the
transaction doesn't matter. As a result, all the following:
loaddata all_data.json
loaddata parents.json children.json
loaddata children.json parents.json
will all be equivalent.
There is, of course, once caveat to this - if you're using MySQL with
InnoDB tables, all bets are off. InnoDB has referential integrity, but
it doesn't defer to end of transaction, so creation order becomes
important. This is a known bug, but one that is impossible to solve in
a generic fashion at our end - we need MySQL to fix their referential
integrity implementation. MyISAM tables aren't affected - they don't
have any referential integrity, so no checks are ever performed.
[1] http://www.djangoproject.com/documentation/serialization/#inherited-models
Yours,
Russ Magee %-)