Re: [SQLObject] Col naming in MultipleJoin
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2003-05-10 18:53:24
|
On Sat, 2003-05-10 at 08:28, deelan wrote: > infact if i change phonenumber "PersonID" with "PersonId" sqlobject > throws out an error:"All foreign key columns must end with 'ID'" > perhaps i'm missing something obvious here. That was a fairly arbitrary requirement. The naming requirement still exists in CVS, but it's case-insensitive, which would fix your problem. So feel free to remove or modify that assert, since the behavior will be fixed for 0.4. > linked to this issue adding a new phonenumber to > person "p" instance requies the oddly named "PersonID" > > p = Person(1) > > this fails: > pn = PhoneNumber.new(phone='666', type='home', PersonId=p.id) > > this works: > pn = PhoneNumber.new(phone='666', type='home', PersonID=p.id) Because you are defining an attribute you named PhoneNumber.PersonID (which happens to equate to number.PersonId in the database). So even if you named it that against your will ;), it's just being consistent. Ian |