def post(self): terminal = Terminal() if len(self.request.arguments()) == 0 or not self.request.get('sku') or not self.request.get('unit_price'): self.render('set_price.html') else: sku = self.request.get('sku') unit_price = self.request.get('unit_price') bulk_price = self.request.get('bulk_price') bulk_quantity = self.request.get('bulk_quantity') currency = self.request.get('currency') if terminal.get_product_details(sku): if len(currency) == 0: terminal.set_price(authenticated=True, DBNames=[Product], sku=sku, unit_price=unit_price, bulk_price=bulk_price, bulk_quantity=bulk_quantity) self.write(json.dumps(terminal.get_product_details(sku))) else: terminal.set_price(authenticated=True, DBNames=[Product], sku=sku, unit_price=unit_price, bulk_price=bulk_price, bulk_quantity=bulk_quantity, currency=currency) self.write(json.dumps(terminal.get_product_details(sku))) else: self.write("item not found")