def get(self): template_values = getHeader() template_values["ppl"] = [] path = os.path.join(os.path.dirname(__file__) + '/people', 'people.html') rows = db.GqlQuery("SELECT * FROM People") for row in rows.run(limit = 100): p = row populateLinks(p) template_values["ppl"].append(p) self.response.out.write(template.render(path, template_values))
def get(self): template_values = getHeader() template_values["crs"] = [] template_values["ppl"] = [] template_values["orgs"] = [] rows = db.GqlQuery("SELECT * FROM Crisis") for row in rows.run(limit = 100): p = row populateLinks(p) template_values["crs"].append(p) rows = db.GqlQuery("SELECT * FROM Organization") for row in rows.run(limit = 100): p = row populateLinks(p) template_values["orgs"].append(p) rows = db.GqlQuery("SELECT * FROM People") for row in rows.run(limit = 100): p = row populateLinks(p) template_values["ppl"].append(p) path = os.path.join(os.path.dirname(__file__), 'index.html') self.response.out.write(template.render(path, template_values))
class CrisesIndividualPage(webapp.RequestHandler): def get(self, crisis_id): template_values = getHeader() crisis_id = eliminateHtmlTag(crisis_id) rows = db.GqlQuery("SELECT * FROM Crisis WHERE model_id='" + crisis_id + "'") if(rows.count() > 0): p = rows.fetch(1)[0] path = os.path.join(os.path.dirname(__file__) + '/crises', 'crisis.html') p.locationString = p.getLocationString() p.count = rows.count() populateLinks(p); template_values["crisis"] = p else: path = os.path.join(os.path.dirname(__file__), 'unknown.html') self.response.out.write(template.render(path, template_values)) class OrgIndividualPage(webapp.RequestHandler): def get(self, org_id): template_values = getHeader() org_id = eliminateHtmlTag(org_id) rows = db.GqlQuery("SELECT * FROM Organization WHERE model_id='" + org_id + "'")