I have this model:
class Entry(db.Model):
title = db.StringProperty()
url = db.URLProperty()
date = db.DateTimeProperty(auto_now=True)
image = db.URLProperty()
weight = db.IntegerProperty()
category = db.StringProperty()
desc = db.TextProperty()
I have lots of entries each day, how do I SELECT only today's entries by using GGL ? since query like this does not return any results ( but I know that there is results ):
SELECT * FROM Entry WHERE category = 'news' and date = '2012-03-12' ORDER BY weight DESC
If anyone need to looking for a datetime, it works for me in GQL:
I hope it help to anyone
It's not saved as a string, but as a datetime like object.
http://code.google.com/appengine/docs/python/datastore/gqlreference.html
So in your example, use either of these.
For datetime the time is by default set to 00:00, so equality comparison will fail therefore you must use > to compare