Thanks I hadn't tried that one, that makes the code look nicer
Jose

> -------- Original Message --------
> Subject: Re: [Sqlalchemy-users] Is this the best way to do this or is
> there a better way?
> From: Michael Bayer <[EMAIL PROTECTED]>
> Date: Thu, September 21, 2006 1:46 pm
> To: [EMAIL PROTECTED]
> Cc: sqlalchemy-users@lists.sourceforge.net
> 
> you can try off the class, as Tgmouse.c.pathnum
> 
> On Sep 21, 2006, at 2:36 PM, [EMAIL PROTECTED] wrote:
> 
> > Dear Sqlalchemy group,
> >
> > I'm pretty new to sqlalchemy and trying it out on a new project at  
> > work.
> >  I've been looking that the docs, and I've got a really simple  
> > question.
> >  I've set up a session ( db = create_session() ) and now want to do a
> > query with said session, but i want to do "like" type of query, so:
> >
> >
> > without a like clause I could do:
> > db.query(Tgmouse).select_by(pathnum = 'TG02-0010SK') or
> > db.query(Tgmouse).select_by(tgmouse_table.c.pathnum == 'TG02-0010SK')
> >
> > but or a like clause the only thing I've figured out i can do is:
> > db.query(Tgmouse).select_by(tgmouse_table.c.pathnum.like('% 
> > TG02-0010SK%'))
> >
> > Is there a way to do the query with with our referring directly to
> > tgmouse_table?
> > Thanks for any and all help
> >
> > Jose
> >
> >
> > ---------------------------------------------------------------------- 
> > ---
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to  
> > share your
> > opinions on IT & business topics through brief surveys -- and earn  
> > cash
> > http://www.techsay.com/default.php? 
> > page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Sqlalchemy-users mailing list
> > Sqlalchemy-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to