Ejemplo n.º 1
0
 def get(self, post_code):
     v = simple_validate({"post_code": post_code})
     if v["valid"]:
         sr = db.get(self.request.get("k"))
         v["supply_request"] = utilities.sr_improver([sr])[0]
         v["status_choices"] = list(SupplyRequest.status.choices)
         v["def"] = DeliveryEventForm()
         v["delivery_events"] = DeliveryEvent.all()
         html = render.page(self, "templates/forms/update_supply_request.html", v)
         self.response.out.write(html)
     else:
         self.response.out.write("Post not found")
Ejemplo n.º 2
0
 def post(self, post_code):
     v = simple_validate({'post_code': post_code})
     if v['valid']:
         PR = self.request.POST
         supply_request = db.get(PR['k'])
         supply_request.status = PR['status']
         supply_request.status_notes = PR['status_notes']
         if PR['delivery_event'] == "Other":
             de = DeliveryEvent(name=PR['name'],
                                date=datetime.strptime(
                                    PR['date'], "%m/%d/%Y"),
                                notes=PR['notes'])
             de.put()
             PD = v['post_default']
             PD.delivery_events.append(de.key())
             PD.put()
             MK = supply_request.medkit
             MK.delivery_events.append(de.key())
             MK.put()
         else:
             de = db.get(PR['delivery_event'])
         supply_request.delivery_event = de
         supply_request.put()
         redirect = "/admin/" + post_code
         self.redirect(redirect)
     else:
         self.response.out.write("Post not found")
Ejemplo n.º 3
0
 def get(self, post_code):
     v = simple_validate({'post_code': post_code})
     if v['valid']:
         sr = db.get(self.request.get("k"))
         v["supply_request"] = utilities.sr_improver([sr])[0]
         v['status_choices'] = list(SupplyRequest.status.choices)
         v["def"] = DeliveryEventForm()
         v["delivery_events"] = DeliveryEvent.all()
         html = render.page(self,
                            "templates/forms/update_supply_request.html", v)
         self.response.out.write(html)
     else:
         self.response.out.write("Post not found")
Ejemplo n.º 4
0
 def post(self, post_code):
     v = simple_validate({"post_code": post_code})
     if v["valid"]:
         PR = self.request.POST
         supply_request = db.get(PR["k"])
         supply_request.status = PR["status"]
         supply_request.status_notes = PR["status_notes"]
         if PR["delivery_event"] == "Other":
             de = DeliveryEvent(name=PR["name"], date=datetime.strptime(PR["date"], "%m/%d/%Y"), notes=PR["notes"])
             de.put()
             PD = v["post_default"]
             PD.delivery_events.append(de.key())
             PD.put()
             MK = supply_request.medkit
             MK.delivery_events.append(de.key())
             MK.put()
         else:
             de = db.get(PR["delivery_event"])
         supply_request.delivery_event = de
         supply_request.put()
         redirect = "/admin/" + post_code
         self.redirect(redirect)
     else:
         self.response.out.write("Post not found")