def post(self): name = self.request.get("name") existing = model.Region.query(model.Region.name == name).get() if not existing: region = model.Region(name=name) region.put() self.redirect("/admin/add_region")
def create_region(self, display_name): the_region = M.Region(id=display_name.lower(), display_name=display_name) return self.insert_region(the_region, self.mongo_client, database_name=DATABASE_NAME)