python 查询特定日期和之后的实体。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 查询特定日期和之后的实体。相关的知识,希望对你有一定的参考价值。

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

以上是关于python 查询特定日期和之后的实体。的主要内容,如果未能解决你的问题,请参考以下文章