python - Google App Engine GQL Query ORDER BY date_posted -
i have following model:
class post(db.model): author = db.stringproperty(required=true) content = db.stringproperty(required=true) date_posted = db.datetimeproperty()
and following gql query:
db.gqlquery("select * post order date_posted limit 10")
yet posts still displayed in seemingly random order. doing wrong?
using framework: web.py
didn't forget correctly set date_posted? or maybe wanted model auto assign current time? if so, have forgot set auto_now_add=true:
date_posted = db.datetimeproperty(auto_now_add=true)
Comments
Post a Comment