I'm trying to create something of a genealogy database, I've had some
success, but I've also run into a couple of problems, so I thought I'd
post here to see if anyone could enlighten me as to the correct way to
accomplish this using SQLObject.

So far the relevant portions of my model.py look like this:


class Person(SQLObject):
        firstName  = StringCol()
        familyName = StringCol()
        father     = ForeignKey('Person')
        mother     = ForeignKey('Person')
        siblings   = RelatedJoin('Person', joinColumn='siblings')
        children   = MultipleJoin('Person', joinColumn='father_id')
        gender     = EnumCol(enumValues=['Male','Female'])

I'm encountering some problems with how to handle the MultipleJoins for
the children field, and the RelatedJoins for siblings.

MultipleJoin issues, as posted above, when a person father is assigned,
they are correctly listed as a child of said father.  Unfortunately
this is not the case for assigning a mother because I don't know how to
specify two joinColumns for children.  Is there any clever trick to
work around this?

RelatedJoin issues, unlike other examples I've found, a sibling is a
siblings sibling, that sounds weird but I'm pretty sure its true, so
I'm try to join the table to itself and the column to itself.  I've
tried various permutation of settings for joinColumn, otherColumn, and
intermediate class, but it never seems to work.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to