medecau
unread,May 9, 2008, 7:23:17 AM5/9/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google App Engine
Hi,
i was attempting to solve the search users that match some given
criteria problem and found this solution:
given:
class userprofile(db.Model):
user=db.UserProperty()
nickname=db.StringProperty()
this:
q=self.request.get('q')
results=userprofile.all().filter('nickname >', q).filter('nickname <',
q+'z').fetch(50)
will return a list of userprofile objects that match 50 users witch
have a nickname that begins with the string passed in "q"
this works ok for me but i was wondering if there is a prettier or
more extesible way of doing it.
i am wondering if it is possible to do near regular expression
matching, haven't seen anything on documentation.