[SQLObject] Explicitly Specifying Join Table Name
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: CLIFFORD I. <cli...@di...> - 2004-06-17 10:39:54
|
Hi, Many to many relationships are represented by RelatedJoin but apparently, the join class is not referenced explicitly. What happens if we have preexisting tables and their names do not meet the criteria for SQLObject? e.g. say we have a many to many relationship between people and groups. class Person(SQLObject): userId = StringCol(length=16, alternateID=True) name = StringCol(length=50) groups = RelatedJoin('Grp') class Grp(SQLObject): codecode = StringCol(length=6, alternateID=True, unique=True, notNone=True) people = RelatedJoin('Person') I think this will try to reference a join table called grp_person, which is not what I want. The table is actually called grp_memberships. I know it is possible to override class and attribute names but I do not think the class GrpPerson is actually generated. How should I deal with this? Regards, Clifford Ilkay Dinamis Corporation 3266 Yonge Street, Suite 1419 Toronto, Ontario Canada M4N 3P6 Tel: 416-410-3326 |