Ejemplo n.º 1
0
    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")
Ejemplo n.º 2
0
 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)