Last active
October 19, 2016 13:24
-
-
Save topless/10e2ad9d3eebc2760612 to your computer and use it in GitHub Desktop.
Query entities from a specific date and forth.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/gae-init/gae-init, for the rest of the functions | |
import datetime | |
def entities_from_date(): | |
cursor = {'prev': None, 'next': None} | |
test_date = datetime.datetime.now() - datetime.timedelta(days=2) | |
entity_dbs_qry = model.Entity.query(model.Entity.created >= test_date) | |
entity_dbs = entity_dbs_qry.order(-model.Run.created).fetch() | |
return helpers.make_response(entity_dbs, model.Entity.FIELDS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment