On Sun, Feb 25, 2007 at 11:11:54PM +0100, Daniel Nogradi wrote:
> class city(SQLObject):
> name = StringCol( )
> buildings = MultipleJoin( 'building' )
>
> class building(SQLObject):
> name = StringCol( )
> complex = ForeignKey( 'city' )
> floors = MultipleJoin( 'floor' )
>
> class floor(SQLObject):
> name = StringCol( )
> building = ForeignKey( 'building' )
> rooms = MultipleJoin( 'room' )
>
> class room(SQLObject):
> name = StringCol( )
> floor = ForeignKey( 'floor' )
>
> both building.q.complex and building.q.floors throw an AttributeError
...
> Sorry for the typo, building.q.complex should have been building.q.city.
But there is no "city" column in "building". I would recommend you to
start with foreign keys that exactly match referenced tables:
class building(SQLObject):
name = StringCol( )
city = ForeignKey( 'city' )
floor = MultipleJoin( 'floor' )
Alas, there is no building.q.floor because MultipleJoin implemented in
SQLObject by backreferencing from the referenced table's ForeignKey.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss