Re: [SQLObject] SQLObject Class-wide where-condition
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Frank W. <fra...@no...> - 2008-01-17 16:44:13
|
really sorry to ask once more. when i now try using this, i get: TypeError: select() takes exactly 1 argument (2 given) you know why? On Jan 17, 2008 5:33 PM, Oleg Broytmann <ph...@ph...> wrote: > On Thu, Jan 17, 2008 at 05:02:34PM +0100, Frank Wagner wrote: > > yes, this sounds exactly like what i need. > > > > I inserted it, but it doesn??t work - i??m really sorry but can you help > me > > out? > > > > class Reisen(SQLObject): > > class sqlmeta: > > idName="NR" > > REISENR = StringCol(length=20, alternateID=True, > > dbName="REISENR") #CHAR(20) > > def select(self, **kw): > > sresult = SQLObject.select(self, **kw) > > return sresult.filter(NOT(LIKE(Reisen.q.REISENR, "BUS%"))) > > > > i get an error: "TypeError: unbound method select() must be called with > > Reisen instance as first argument" > > Sorry, minor fault. .select() is a class method! > > class Reisen(SQLObject): > ... > def select(cls, **kw): > sresult = SQLObject.select(cls, **kw) > ... > select = classmethod(select) > > Oleg. > -- > Oleg Broytmann http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > |