[SQLObject] MultipleJoin does not respect specified keys
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <jws...@ra...> - 2004-02-29 03:30:08
|
Given the following classes, when I call 'shiptos' on an instance of my
CustAccount class, I see that the resulting SQL looks like 'SELECT shipto_id
FROM shiptos WHERE cust_accounts_id = 2'. It is apparently attempting to
guess what the primary key is based on the Style, even though I specified
the column name by hand. This is just a bit beyond my ability to fix at the
moment.
class CustAccount(SQLObject):
_table = "cust_accounts"
_idName = "cust_id"
name = StringCol()
shiptos = MultipleJoin('Shipto')
class Shipto(SQLObject):
_table = "shiptos"
_idName = "shipto_id"
name = StringCol()
cust = ForeignKey('CustAccount')
|