Exemplo 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)
Exemplo 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)
Exemplo 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")
Exemplo 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)
Exemplo n.º 5
0
 def post(self, item_id):
     items = Allitems.get_by_id(int(item_id))
     items.key.delete()
     return self.redirect_to("list")
Exemplo 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)