Пример #1
0
 def get(self, petKeyUrlSafe):
     user = Authorization.isAuthenticated()
     if user:
         pet = PetService.get(petKeyUrlSafe)
         template_values = {"pet": pet, "buttonName": "Update", "postURL": "/petEdit/" + petKeyUrlSafe}
         template = JINJA_ENVIRONMENT.get_template("partials/petEditable.html")
         self.response.write(template.render(template_values))
     else:
         self.redirect("/")
Пример #2
0
 def get(self, petKeyUrlSafe):
     user = Authorization.isAuthenticated()
     if user:
         pet = PetService.get(petKeyUrlSafe)
         template_values = {
             'pet':pet,
         }
         template = JINJA_ENVIRONMENT.get_template('partials/petReadOnly.html')
         self.response.write(template.render(template_values))
     else:
         self.redirect('/')