Re: [SQLObject] selectBy method problem
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Leandro S. <lea...@gm...> - 2008-01-19 17:40:44
|
In fact, this is another way to do what you want. On 1/19/08, Petr Jake=9A <pet...@tp...> wrote: > Problem solved, > > p =3D MyTable.select(MyTable.q.name =3D=3D "pets") > works instead of: > p =3D MyTable.selectBy(name =3D=3D "pets") > > Sorry for bothering your weekend time :-) > > Petr > > On Jan 19, 2008 6:17 PM, Petr Jake=9A <pet...@tp...> wrote: > > > Hi, I have following problem: > > > > following code throw this error: > > unhandled NameError, global name 'name' is not defined > > and I really do not know what to do to write it properly > > > > class MyTable(SQLObject): > > name=3DStringCol(length=3D20, default=3DNone) > > > > MyTable.createTable(ifNotExists=3DTrue) > > rPets =3D MyTable(name=3D"pets") > > rBirds =3D MyTable( name=3D"birds") > > > > class AnOtherClass(): > > def selbyMethod(self): > > p =3D MyTable.selectBy(name =3D=3D "pets") > > for mRow in p: > > print mRow > > > > myObject=3DAnOtherClass() > > myObject.selbyMethod() > > > > Thanks for your advices > > > > Petr Jakes > > > --=20 Leandro Melo de Sales. Pervasive and Embedded Computing Laboratory BRisa and E-Phone Projects Manager Network Admin @ http://embedded.ufcg.edu.br/indexen.html +55 83 3310-1404 (extension 208) http://www.leandrosales.com/ |