def deserialize(cls, the_dict): if 'name' in the_dict['prod'] and 'prod_id' in the_dict['prod']: prod = ProdItemGroup.deserialize(the_dict['prod']) else: price = PriceList.deserialize(the_dict['prod']) prod = ProdItemGroup(prod_id=price.prod_id, name=price.nombre) cant = Decimal(the_dict['cant']) return cls(prod, cant)
def deserialize(cls, the_dict): prod = PriceList.deserialize(the_dict['prod']) cant = Decimal(the_dict['cant']) return cls(prod, cant)