Re: [SQLObject] Multiple RelatedJoins between the same two classes

2007-07-25 Thread Tim Black
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 "", line 1, in ? AttributeError: 'Project' object has no attribute 'addContractor' What is the right way to specif

Re: [SQLObject] Multiple RelatedJoins between the same two classes

2007-07-25 Thread Oleg Broytmann
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 "", line 1, in ? > AttributeError: 'Project' object has no attribute 'addContractor' > > What is the right way to specify that I'm adding a cont

Re: [SQLObject] Multiple RelatedJoins between the same two classes

2007-07-24 Thread jonhattan
jonathan escribió: > Tim Black escribió: > >> 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 nam

Re: [SQLObject] Multiple RelatedJoins between the same two classes

2007-07-24 Thread jonathan
Tim Black escribió: > 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. > Could

Re: [SQLObject] Multiple RelatedJoins between the same two classes

2007-07-24 Thread Tim Black
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. Could it be that I have to drop to manua

Re: [SQLObject] Multiple RelatedJoins between the same two classes

2007-07-24 Thread Tim Black
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):

Re: [SQLObject] Multiple RelatedJoins between the same two classes

2007-07-23 Thread Oleg Broytmann
On Mon, Jul 23, 2007 at 12:53:41PM -0700, Tim Black wrote: > I'm trying to create more than one RelatedJoin between the same two > classes. I need to construct many-to-many relationships between Persons > and Projects > > class Person(SQLObject): >name = StringCol() >clientProjects = Re

Re: [SQLObject] Multiple RelatedJoins between the same two classes

2007-07-23 Thread pkoe...@gmail.com
Tim Black schrieb: > I've tried to represent this simply as: > > class Person(SQLObject): >name = StringCol() >clientProjects = RelatedJoin("Project") >contractorProjects = RelatedJoin("Project") > > class Project(SQLObject): >name = StringCol() >clients = RelatedJoin("Person"

Re: [SQLObject] Multiple RelatedJoins between the same two classes

2007-07-23 Thread Frank Wagner
Hello Tim, i guess, this is rather a catwalk problem than a sqlobject problem. i guess you are using sqlobject within turbogears? try adding your relations in the interactive shell. you can get one by executing tg-admin shell from within your project folder. then you can try sth. like Projec

[SQLObject] Multiple RelatedJoins between the same two classes

2007-07-23 Thread Tim Black
I posted this on the TurboGears list last week, and don't desire to cross-post. But as it didn't receive a substantive answer, perhaps it is better to send it directly to the SQLObject list. Thanks for your consideration. - Tim I'm trying to create more than one RelatedJoin between the same