def type(self, type): if self.__in_init: self.__dict__["type"] = type return if self.product and type != OrderLineType.PRODUCT: raise ValueError("Can not set a line type for a basket line when it has a product set") if type not in OrderLineType.as_dict(): raise ValueError("Invalid basket line type. Only values of OrderLineType are allowed.") self.__dict__["type"] = type
def type(self, type): if self.__in_init: self.__dict__["type"] = type return if self.product and type != OrderLineType.PRODUCT: raise ValueError("Can not set a line type for a basket line when it has a product set") if type not in OrderLineType.as_dict(): raise ValueError("Invalid basket line type. Only values of OrderLineType are allowed.") self.__dict__["type"] = type