Oleg Broytmann wrote:
   You have to understand that SQLObject creates a hidden intermediate
table that stores cross-pointers for an every pair of RelatedJoins. If you
want to create more than one RelatedJoin you have to give the name for the
tables yourself. Try this:

class Person(SQLObject):
   name = StringCol()
   clientProjects = RelatedJoin("Project", intermediateTable="person_project_clients")
   contractorProjects = RelatedJoin("Project", intermediateTable="person_project_contractors")

class Project(SQLObject):
   name = StringCol()
   clients = RelatedJoin("Person", intermediateTable="person_project_clients")
   contractors = RelatedJoin("Person", intermediateTable="person_project_contractors")
Thank you for your help.  The above created the following tables:


And after running Project.get(1).addPerson(Person.get(2)),

person_project_clients  contains person_id=2, project_id=1
person_project_contractors is empty

After running Project.get(1).addPerson(Person.get(1)),

person_project_clients  contains person_id=2, project_id=1; person_id=1, project_id=1
person_project_contractors is empty

Then I try:

>>> Project.get(1).addContractor(Person.get(1))
Traceback (most recent call last):
  File "<console>", line 1, in ?
AttributeError: 'Project' object has no attribute 'addContractor'

What is the right way to specify that I'm adding a contractor and not a client?