Re: [SQLObject] Intermediate table in RelatedJoins
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Miguel T. <mig...@gm...> - 2009-08-12 10:36:36
|
Hi Oleg! A second intermediate table can be used to state a second many-to-many relationship and it might make more sense to have it in reverse order. Imagine this scenario: class Address(SQLObject): Address = sqlobject.StringCol () People = sqlobject.RelatedJoin ('Person') class Person(SQLObject): Name = sqlobject.StringCol () Addresses = sqlobject.RelatedJoin ('Address') So a Person can have several addresses (House, Work, Beach House, etc) and each Address can be for several Persons (all the member of the family for example). Does this makes any sense? Now, if I wanted to implement the support for several intermediate tables where should I begin? Any ideas? Best regards, Miguel Tavares 2009/8/12 Oleg Broytmann <ph...@ph...>: > On Wed, Aug 12, 2009 at 10:14:38AM +0100, Miguel Tavares wrote: >> But creating the two table might be exactly was is intended >> Hum... shouldn't it create a target_capability too? > > No. SQLObject can use only one intermediate table. Wanna extend this? > Patches (with tests) should be put to the SF tracker. > > But I wonder - what could be the use for a second intermediate table? > > Oleg. > -- > Oleg Broytmann http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > |