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
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss