def get_price(self): """ calculate price """ try: return float(self.price) * float(Constant.get_const('currency')) except TypeError: return float(self.price)
def get_total_price(self): """ return item total price """ try: return float(self.price) * float(self.quantity) * float(Constant.get_const('currency')) except TypeError: return float(self.price) * float(self.quantity)