Joshua Smith
unread,Feb 24, 2016, 9:52:01 AM2/24/16Sign 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
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