def get(self): s = Stock() _d = s.iterDump() for line in _d: self.write(str(line)) self.write("\n") s.Close()
def get(self): try: s = Stock() reply = "" #Check for price/quantity price = self.get_argument('price','') quantity = self.get_argument('quantity','') value = self.get_argument('value','') if(price=='true'): #Get the egg unit price price = s.getItemPrice('egg') reply += "egg unit price: " + str(price) if(quantity=='true'): quantity = s.getItemQuantity('egg') reply += "egg stock level: " + str(quantity) if(value=='true'): #Get item total value total = s.getItemTotal('egg') reply += "egg total stock value: " + str(total) if(reply==""): reply = "OK" self.write(reply) s.Close() except Exception as e: print(e)
def delete(self): s = Stock() self.write("OK") s.Close()