def template_values(): values = memcache.get("template_values") if(values is not None): return values laender = dict([(s.name, s.striking) for s in State.all()]) striking = any(laender.values()) values = {'streik': striking, 'laender': laender, 'title': title(striking), 'twitter_text': twitter_text(striking)} memcache.add("template_values", values) return values
def get(self): states = list(State.all()) template_values = {'states': states} path = os.path.join(os.path.dirname(__file__), 'templates', 'manager.html') self.response.out.write(template.render(path, template_values))
def get_state(self, abbreviation): stateQuery = State.all() stateQuery.filter("abbreviation =", abbreviation) state = stateQuery.get() return state