def get(self, event_key): df = DatafeedFMSAPI('v2.0', save_response=True) event = Event.get_by_id(event_key) alliance_selections = df.getEventAlliances(event_key) if event and event.remap_teams: EventHelper.remapteams_alliances(alliance_selections, event.remap_teams) event_details = EventDetails(id=event_key, alliance_selections=alliance_selections) EventDetailsManipulator.createOrUpdate(event_details) template_values = { 'alliance_selections': alliance_selections, 'event_name': event_details.key.id() } 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/usfirst_event_alliances_get.html') self.response.out.write(template.render(path, template_values))
def get(self, event_key): df = DatafeedFMSAPI('v2.0') event = Event.get_by_id(event_key) if event.event_type_enum == EventType.CMP_FINALS: logging.info("Skipping Einstein alliance selections") return alliance_selections = df.getEventAlliances(event_key) if alliance_selections and event.alliance_selections != alliance_selections: event.alliance_selections_json = json.dumps(alliance_selections) event._alliance_selections = None event.dirty = True EventManipulator.createOrUpdate(event) template_values = { 'alliance_selections': alliance_selections, 'event_name': event.key_name } path = os.path.join( os.path.dirname(__file__), '../templates/datafeeds/usfirst_event_alliances_get.html') self.response.out.write(template.render(path, template_values))
def get(self, event_key): df = DatafeedFMSAPI('v2.0') event = Event.get_by_id(event_key) alliance_selections = df.getEventAlliances(event_key) event_details = EventDetails( id=event_key, alliance_selections=alliance_selections ) EventDetailsManipulator.createOrUpdate(event_details) template_values = {'alliance_selections': alliance_selections, 'event_name': event_details.key.id()} 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/usfirst_event_alliances_get.html') self.response.out.write(template.render(path, template_values))
def get(self, event_key): df = DatafeedFMSAPI('v2.0') event = Event.get_by_id(event_key) alliance_selections = df.getEventAlliances(event_key) if alliance_selections and event.alliance_selections != alliance_selections: event.alliance_selections_json = json.dumps(alliance_selections) event._alliance_selections = None event.dirty = True EventManipulator.createOrUpdate(event) template_values = {'alliance_selections': alliance_selections, 'event_name': event.key_name} 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/usfirst_event_alliances_get.html') self.response.out.write(template.render(path, template_values))
def get(self, event_key): df = DatafeedFMSAPI('v2.0') event = Event.get_by_id(event_key) if event.event_type_enum == EventType.CMP_FINALS: logging.info("Skipping Einstein alliance selections") return alliance_selections = df.getEventAlliances(event_key) if alliance_selections and event.alliance_selections != alliance_selections: event.alliance_selections_json = json.dumps(alliance_selections) event._alliance_selections = None event.dirty = True EventManipulator.createOrUpdate(event) template_values = {'alliance_selections': alliance_selections, 'event_name': event.key_name} path = os.path.join(os.path.dirname(__file__), '../templates/datafeeds/usfirst_event_alliances_get.html') self.response.out.write(template.render(path, template_values))
def get(self, event_key): df = DatafeedFMSAPI('v2.0') event = Event.get_by_id(event_key) alliance_selections = df.getEventAlliances(event_key) if alliance_selections and event.alliance_selections != alliance_selections: event.alliance_selections_json = json.dumps(alliance_selections) event._alliance_selections = None event.dirty = True EventManipulator.createOrUpdate(event) template_values = { 'alliance_selections': alliance_selections, 'event_name': event.key_name } 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/usfirst_event_alliances_get.html') self.response.out.write(template.render(path, template_values))