On Sun, Mar 09, 2008 at 08:52:28PM -0700, Daniel Fetchinson wrote:
> class zoo( SQLObject ):
> cages = MultipleJoin( 'cage' )
>
> class cage( SQLObject ):
> zoo = ForeignKey( 'zoo' )
> animals = MultipleJoin( 'animal' )
> properties = RelatedJoin( 'property' )
>
> class animal( SQLObject ):
> cage = ForeignKey( 'cage' )
> properties = RelatedJoin( 'property' )
>
> class property( SQLObject ):
> animals = RelatedJoin( 'animal' )
> cages = RelatedJoin( 'cage' )
>
>
> What would be the select call for selecting all properties for a given
> zoo instance?
SQLObject cannot automagically construct such a comple SQL query. You
can do it in Python:
z = zoo.get(id)
zoo_properties = []
for c in z.cages:
for a in c.animals:
for p in a.properties:
zoo_properties.append(p)
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss