本文整理汇总了Python中datafeeds.datafeed_fms_api.DatafeedFMSAPI.getEventList方法的典型用法代码示例。如果您正苦于以下问题:Python DatafeedFMSAPI.getEventList方法的具体用法?Python DatafeedFMSAPI.getEventList怎么用?Python DatafeedFMSAPI.getEventList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datafeeds.datafeed_fms_api.DatafeedFMSAPI
的用法示例。
在下文中一共展示了DatafeedFMSAPI.getEventList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from datafeeds.datafeed_fms_api import DatafeedFMSAPI [as 别名]
# 或者: from datafeeds.datafeed_fms_api.DatafeedFMSAPI import getEventList [as 别名]
def get(self, year):
df = DatafeedFMSAPI('v2.0')
df2 = DatafeedFIRSTElasticSearch()
fmsapi_events, fmsapi_districts = df.getEventList(year)
elasticsearch_events = df2.getEventList(year)
merged_events = EventManipulator.mergeModels(fmsapi_events, elasticsearch_events)
events = EventManipulator.createOrUpdate(merged_events)
districts = DistrictManipulator.createOrUpdate(fmsapi_districts)
# Fetch event details for each event
for event in events:
taskqueue.add(
queue_name='datafeed',
target='backend-tasks',
url='/backend-tasks/get/event_details/'+event.key_name,
method='GET'
)
template_values = {
"events": events,
"districts": districts,
}
if 'X-Appengine-Taskname' not in self.request.headers: # Only write out if not in taskqueue
path = os.path.join(os.path.dirname(__file__), '../templates/datafeeds/fms_event_list_get.html')
self.response.out.write(template.render(path, template_values))
示例2: get
# 需要导入模块: from datafeeds.datafeed_fms_api import DatafeedFMSAPI [as 别名]
# 或者: from datafeeds.datafeed_fms_api.DatafeedFMSAPI import getEventList [as 别名]
def get(self, year):
df = DatafeedFMSAPI('v2.0')
new_events = EventManipulator.createOrUpdate(df.getEventList(year))
# Fetch EventTeams for each event
for event in new_events:
taskqueue.add(
queue_name='fms-api',
url='/tasks/get/fmsapi_eventteams/'+event.key_name,
method='GET'
)
template_values = {
"events": new_events
}
path = os.path.join(os.path.dirname(__file__), '../templates/datafeeds/fms_event_list_get.html')
self.response.out.write(template.render(path, template_values))
示例3: get
# 需要导入模块: from datafeeds.datafeed_fms_api import DatafeedFMSAPI [as 别名]
# 或者: from datafeeds.datafeed_fms_api.DatafeedFMSAPI import getEventList [as 别名]
def get(self, year):
df = DatafeedFMSAPI('v2.0')
df2 = DatafeedFIRSTElasticSearch()
merged_events = EventManipulator.mergeModels(df.getEventList(year), df2.getEventList(year))
events = EventManipulator.createOrUpdate(merged_events)
# Fetch event details for each event
for event in events:
taskqueue.add(
queue_name='datafeed',
url='/backend-tasks/get/event_details/'+event.key_name,
method='GET'
)
template_values = {
"events": events
}
path = os.path.join(os.path.dirname(__file__), '../templates/datafeeds/fms_event_list_get.html')
self.response.out.write(template.render(path, template_values))