Oleg Broytmann wrote:
On Tue, Jul 24, 2007 at 09:35:34AM -0700, Tim Black wrote:
  
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?
    

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

class Project(SQLObject):
   name = StringCol()
   clients = RelatedJoin("Person",
      intermediateTable="person_project_clients",
      addRemoveName="Person")
   contractors = RelatedJoin("Person",
      intermediateTable="person_project_contractors",
      addRemoveName="Contractor")
  
Thank you!  That solved my problem.  The model works now in the tg-admin shell and in Catwalk.

Tim