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 whenever I go to populate the database, usually
in catwalk, I get some complaints.  Does anyone know a better, or more
correct, way to handle this?  I must admit I'm still getting used to
SQLObject.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to