In fact, this is another way to do what you want.

On 1/19/08, Petr Jakeš <[EMAIL PROTECTED]> wrote:
> Problem solved,
>
> p = MyTable.select(MyTable.q.name == "pets")
> works instead of:
> p = MyTable.selectBy(name == "pets")
>
> Sorry for bothering your weekend time :-)
>
> Petr
>
> On Jan 19, 2008 6:17 PM, Petr Jakeš <[EMAIL PROTECTED]> 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=StringCol(length=20, default=None)
> >
> > MyTable.createTable(ifNotExists=True)
> > rPets = MyTable(name="pets")
> > rBirds = MyTable( name="birds")
> >
> > class AnOtherClass():
> >     def selbyMethod(self):
> >         p = MyTable.selectBy(name == "pets")
> >         for mRow in p:
> >             print mRow
> >
> > myObject=AnOtherClass()
> > myObject.selbyMethod()
> >
> > Thanks for your advices
> >
> > Petr Jakes
> >
>


-- 
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/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to