Yarko,

I'll keep the Python->SQL translation in mind. You are right of course
on the slice. My first run at the construct was to filter it against
the output of a unfiltered query of the table.


Massimo,

You guessed right. I want to select a range of lastnames, say A - M
based on the first letter of the last name.

Thanks guys will be able to get the results I am looking for.

JohnMc



On May 21, 5:44 pm, Yarko Tymciurak <yark...@gmail.com> wrote:
> On Thu, May 21, 2009 at 5:40 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > My guess is that you want all people with a last starting with a
> > letter 'A' you can do
>
> >   qy = dbhlx((dbhlx.contact.lastname.like('A%')).select()
>
> Right - the point being, you need to think in terms of SQL forming (to fetch
> your data); not in terms of Python data-slicing ;-)
>
>
>
> > or
> >   c='A'
> >   qy = dbhlx((dbhlx.contact.lastname.like(c+'%')).select()
>
> > you can combine multiple queries with OR.
>
> > OR and like(..) do not work on GAE.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to