本文整理汇总了Python中models.event.Event.return_all_events方法的典型用法代码示例。如果您正苦于以下问题:Python Event.return_all_events方法的具体用法?Python Event.return_all_events怎么用?Python Event.return_all_events使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.event.Event
的用法示例。
在下文中一共展示了Event.return_all_events方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models.event import Event [as 别名]
# 或者: from models.event.Event import return_all_events [as 别名]
def get(self):
self.response.write('Welcome to attender server! Here is a cron job for pulling events from sorces: meetup.com and evenbrite.com')
ev = Event()
at = Attendings()
logging.info("Adding new events to DataStore")
results = self.obj.request_events(radius="25")
logging.info("Events added: {}".format(results))
logging.info("Deleting old events from DataStore")
#Delete passed events
qe = ev.return_all_events()
results = qe.filter(Event.date < datetime.now())
for res in results:
logging.info(str(res.key.id()))
old_attending = Attendings.query(Attendings.event_id == int(res.key.id())).get()
logging.info("query {}".format(old_attending))
if old_attending is not None:
old_attending.key.delete()
res.key.delete()
#Update city names
for q in qe:
changed = self.api_obj.check_city(q.city)
if changed:
q.city = changed
q.put()