I just wrote a new app and it has an entity that I use to show a leader board:
class CountModel(db.Model):
count = db.IntegerProperty(default=0)
trend = db.FloatProperty(default=0.0)
I get the list of these using a simple query:
if self.request.get("mode") == "trend":
counts = CountModel.gql("ORDER BY trend DESC").fetch(20)
else:
counts = CountModel.gql("ORDER BY count DESC").fetch(20)
I ran this in my dev environment and then checked index.yaml to make sure it
made the indexes. It didn’t.
So I pushed it to production, fully expecting to see an error when I ran the
query because I didn’t have this index defined. No error.
It works perfectly.
I also have this query in a cron job, and it works fine without the index, too:
for c in CountModel.gql("WHERE trend > 1"):
Has something changed? It used to be that to do an ordered query, or an
inequality query, you had to have an index.
-Joshua
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/38ED761B-EEBE-4CED-80B6-ADF42357BF57%40gmail.com.
For more options, visit https://groups.google.com/d/optout.