On 2/14/2014 2:34 PM, Michael Bayer wrote:
A basic fact of a self referential relationship is that you're building a tree.
The root of the tree has to be NULL and I'd advise against trying to work
around that.
Now if you wanted to in fact assign the object's own primary key to the foreign
key column, you can (manually), but even then, you'd need to know the primary
key up front. If you're relying on the database to generate a primary key
value, you still won't have that value in time, and the column would still be
NULL.
It seems to work ok if I just fake the id=0 and a1.sire_id=0, we'll see what
happens when I move
to PostgreSQL. So for the moment I can move on to other fires.
I think where you're at with this you might want to keep it simple to start.
Yes. But I've had this working for quite a while now on the Django ORM, never
considered that it was something particularly unusual.
Thanks,
Michael
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.