Trying to access the price of a product using Docs . But getting the attribute error.
>>> from oscar.apps.partner import strategy, prices >>> from oscar.apps.catalogue.models import * >>> product = Product.objects.get(pk=1) >>> info = strategy.fetch_for_product(product) Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'module' object has no attribute 'fetch_for_product'
To see all the attributes of a strategy, I do
>>> dir(strategy) >>> ['Base', 'D', 'Default', 'DeferredTax', 'FixedRateTax', 'NoTax', 'PurchaseInfo', 'Selector', 'StockRequired', 'Structured', 'UK', 'US', 'UseFirstStockRecord', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 'availability', 'namedtuple', 'prices']
So fetch_for_product is not included in the attributes of the strategy. Now, how can I access the price of a particular product?
source share