[SQLObject] How to access intermediate table columns?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Tomas F. <fu...@ya...> - 2004-11-15 13:11:56
|
Hi all, i would like to ask you if could be possible to acces intermediate table column in many to many relationship. For example: CREATE TABLE person ( id SERIAL, username VARCHAR(100) NOT NULL UNIQUE ); CREATE TABLE role ( id SERIAL, name VARCHAR(50) NOT NULL UNIQUE ); CREATE TABLE assigned_roles ( person INT NOT NULL, role INT NOT NULL, assigned_date DATE ); I would like to access the assigned_date column. Does anybody have any idea? In the docs there is following solution, but without using any columns from intermediate table. class Person(SQLObject): username = StringCol(length=100, alternateID=True) roles = RelatedJoin('Role', joinColumn='person', otherColumn='role', intermediateTable='assigned_roles') class Role(SQLObject): name = StringCol(length=50, alternateID=True) roles = RelatedJoin('Person', joinColumn='role', otherColumn='person', intermediateTable='assigned_roles') Thanks for ideas Tomas __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com |