Thanks, Andy. You are correct, my mistake. I saw some strange behavior
with the data that I was working with and I couldn't figure why the
return values made sense for the query. There I had StringProperty
instead of TextProperty. I thought I will construct a quick example
and made the mistake of using the wrong type in that process. That
said, I have made so many changes since this issue surfaced that I
have forgotten exactly which data values in the query caused the
problem. I will try to reproduce on the larger data that I have. If I
cannot then it is either a browser caching problem or it was too late
and was not thinking clearly :)

Thanks again!


On Apr 20, 7:21 am, Andy Freeman <ana...@earthlink.net> wrote:
> db.TextProperty is not an indexable property.  That means that it's
> not queryable either.
>
> It would be nice if to get an exception or some other indication of
> what's going on.
>
> However, note that "indexable" is something that happens in the
> datastore when an instance is store.  If you change a property from
> StringProperty to TextProperty or the reverse, strange things will
> probably happen.  (If you put some instances with StringProperty, I
> suspect that you can still successfully query for those instances
> using that property after you've switched to TextProperty.)
>
> On Apr 19, 1:24 am, ecognium <ecogn...@gmail.com> wrote:
>
> > Hello everyone, I noticed an odd behavior with GQL query when it has
> > two IN operators and a regular condition. Below is some basic code to
> > reproduce the problem:
>
> > class DummyData(db.Model):
> >         x = db.StringListProperty()
> >         y = db.TextProperty()
>
> > class Dummy(webapp.RequestHandler):
> >     def get(self):
> >         d = DummyData()
> >         d.x = ['a', 'b','c']
> >         d.y = "test"
> >         d.put()
> >         d = DummyData()
> >         d.x = ['c', 'd','e']
> >         d.y = "test2"
> >         d.put()
>
> >         q = db.GqlQuery("SELECT * FROM DummyData where x in ('c') and
> > x in ('a') ")
> >         results = q.fetch(10) # 10 instead of 2? - useful if you run
> > the test multiple times
> >         for r in results:
> >             self.response.headers['Content-Type'] = "text/plain"
> >             self.response.out.write("x = " + ",".join(r.x) + " y = " +
> > r.y + "\n")
>
> > When you run the above code you will see the following output:
> > x = a,b,c y = test
>
> > However when I replace the above query with the one below, I do not
> > get any  results (even though it should return the same result as
> > above):
>
> > # Note the addition of y = 'test'
> > q = db.GqlQuery("SELECT * FROM DummyData where y = 'test' and x in
> > ('c') and x in ('a') ")
>
> > Although here the IN conditions are the same as '=', my application
> > actually uses multiple list values.; I am just presenting a simpler
> > example.
>
> > If someone can confirm the issue, I can open a bug report for this.
>
> > Thanks!
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to