Franz Noel
Franz Noel

Reputation: 1900

Filter by exact date after receiving webapp2 request on Python GAE

After receiving the the date by q = self.request.get('q'), I am trying to filter by complete date, but it gives me blank results. My query is as follows:

custQuery = db.Query(Customer)
birthdate = datetime.strptime(q,"%Y-%m-%d")
custQuery.filter('birthdate >= ',birthdate)
custQuery.filter('birthdate < ',birthdate)

But, I get blank results although I know that the q(which is the certain date) is existing and I have an existing birthdate property. What is the proper way to filter requests by exact date on Google App Engine?

Upvotes: 0

Views: 265

Answers (1)

Franz Noel
Franz Noel

Reputation: 1900

Silly me. It should be equal sign.

custQuery = db.Query(Customer)
birthdate = datetime.strptime(q,"%Y-%m-%d").date()
custQuery.filter('birthdate = ',birthdate)

Upvotes: 1

Related Questions