def post(self): if self.request.get("submit_bus") == "1": bus_id = self.request.get("selectbus") # self.response.write(bus_id) parent = TripsHeadsigns.query().fetch(1)[0].key.parent() # self.response.write(parent) bus = TripsHeadsigns.get_by_id(bus_id, parent=parent) # self.response.write(bus) main.change_bus(bus) home.get(self)
def get(self): main.set_pre_page("alertincident") if main.register_required(): self.redirect('registration') page_title = "Alert Incident" # retrieve values from the datastore entities_query2 = PassengerAlert.query() entities2 = entities_query2.fetch(10) template_values = { 'page_title': page_title, #'entities2': entities2, 'headsigns2' : TripsHeadsigns.find(), 'stops': Stops.find() } template = JINJA_ENVIRONMENT.get_template('templates/alertincident.html') self.response.write(template.render(template_values))
def get(self): # For endpoints to work, https must be used. Redirect to https # if not running on localhost. # parsed = urlparse(self.request.url) # if parsed.scheme == 'http' and parsed.hostname != 'localhost': # # Redirect to https. # self.redirect("https" + self.request.url[4:]) # return page_title = "Home" entities = Alert.query().order(Alert.title) current_bus = main.current_bus() template_values = { "page_title": page_title, "entities": entities, "headsigns": TripsHeadsigns.find(), "current_bus": current_bus, } template = JINJA_ENVIRONMENT.get_template("templates/home.html") self.response.write(template.render(template_values))