예제 #1
0
파일: PetDelete.py 프로젝트: rowex105/fetch
 def get(self, petKeyUrlSafe):
     user = Authorization.isAuthenticated()
     if user:
         PetService.delete(petKeyUrlSafe)
         self.redirect('/clients')
     else:
         self.redirect('/')
예제 #2
0
파일: PetAddNew.py 프로젝트: rowex105/fetch
 def post(self, clientKeyUrlSafe):
     user = Authorization.isAuthenticated()
     if user:
         try:
             PetService.addNew(clientKeyUrlSafe, self.request)
         except:
             logging.error("PetAddNew.py => post(self, clientKeyUrlSafe) => an exception was thrown trying to create a new Pet")
         finally:
             self.redirect('/clients')
     else:
         self.redirect('/')
예제 #3
0
파일: PetEdit.py 프로젝트: rowex105/fetch
 def post(self, petKeyUrlSafe):
     user = Authorization.isAuthenticated()
     if user:
         try:
             PetService.update(petKeyUrlSafe, self.request)
             # petService = PetService(self.request)
             # petService.update(petName, clientPhone)
         except:
             logging.error(
                 "PetEdit.py => post(self, phoneNumber) => an exception was thrown trying to create a new Pet"
             )
         finally:
             self.redirect("/clients")
     else:
         self.redirect("/")
예제 #4
0
파일: PetEdit.py 프로젝트: rowex105/fetch
 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("/")
예제 #5
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('/')
예제 #6
0
파일: Clients.py 프로젝트: rowex105/fetch
 def get(self):
     user = Authorization.isAuthenticated()
     if user:
         clients = ClientService.getAll()
         pets = PetService.getAll()
         template_values = {
             'clients':clients,
             'pets':pets,
         }
         template = JINJA_ENVIRONMENT.get_template('partials/clients.html')
         self.response.write(template.render(template_values))
     else:
         self.redirect('/')