topless
10/16/2015 - 8:42 AM

Query entities from a specific date and forth.

Query entities from a specific date and forth.

# 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)