>From http://code.google.com/appengine/docs/datastore/queriesandindexes.html:
Query filters do not have an explicit way to match just part of a
string value, but you can fake a prefix match using inequality
filters:
db.GqlQuery("SELECT * FROM MyModel WHERE prop >= :1 AND prop < :2",
"abc", u"abc" + u"\xEF\xBF\xBD")
This matches every MyModel entity with a string property prop that
begins with the characters abc. The byte string "\xEF\xBF\xBD"
represents the largest possible Unicode character. When the property
values are sorted in an index, the values that fall in this range are
all of the values that begin with the given prefix.
--
www.muspy.com
On Oct 19, 9:45 pm, v4vijayakumar <[EMAIL PROTECTED]>
wrote:
> Is it possible to do something like this, on model "test"?
>
> q = test.gql ('where a = :1', 'b1*')
>
> --
> class test(db.Model):
> a = db.StringProperty()
> b = db.StringProperty()
>
> test(a='a1:test', b='b1:test').put()
> test(a='a1:test', b='b2:test').put()
> test(a='a2:test', b='b1:test').put()
> test(a='a2:test', b='b2:test').put()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---