Esempio n. 1
0
 def post(self, item_id):
     items = Allitems.get_by_id(int(item_id))
     items.item_totalprice = items.item_price * items.item_qty
     items.put()
     for prices in items:
         total = total + prices.item_totalprice
     params = {"items": items, "total": round(total, 2)}
     return self.render_template("items_selected.html", params=params)
Esempio n. 2
0
 def post(self, item_id):
     items = Allitems.get_by_id(int(item_id))
     items.item_select = True
     items.item_qty = float(self.request.get(item_id))
     items.item_totalprice = items.item_qty * items.item_price
     items.put()
     select = Allitems.query(Allitems.item_select == True).fetch()
     params = {"selected": len(select)}
     return self.render_template("items_all.html", params=params)
Esempio n. 3
0
 def post(self, item_id):
     newname = self.request.get("item_name")
     newprice = float(self.request.get("item_price").replace(",", "."))
     import re
     findings = re.findall("<(\w+)>", newname)
     if findings:
         pass
     else:
         items = Allitems.get_by_id(int(item_id))
         items.item_name = newname
         items.item_price = newprice
         items.put()
     return self.redirect_to("list")
Esempio n. 4
0
 def get(self, item_id):
     items = Allitems.get_by_id(int(item_id))
     params = {"items": items}
     return self.render_template("items_all.html", params=params)
Esempio n. 5
0
 def post(self, item_id):
     items = Allitems.get_by_id(int(item_id))
     items.key.delete()
     return self.redirect_to("list")
Esempio n. 6
0
 def get(self, item_id):
     items = Allitems.get_by_id(int(item_id))
     selected = Allitems.query(Allitems.item_select == True).fetch()
     params = {"items": items, "selected": len(selected)}
     return self.render_template("items_delete.html", params=params)