Re: [SQLObject] Overloading related joins and multiple joins
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2004-02-26 18:00:16
|
Victor Ng wrote: > If I have two classes like this: > > class Foo(SQLObject): > bars = RelatedJoin('Bar') > > class Bar(SQLObject): > foos = RelatedJoin('Foo') > > Is there a way for me to overload the addFoo and addBar method for Bar > and Foo? Only by brute force: class Foo(SQLObject): bars = RelatedJoin('Bar') oldAddBar = Foo.addBar def newAddBar(self): result = oldAddBar(self) yada yada Foo.addBar = newAddBar Cheers, Ian |