<p>我有一份产品清单。我想得到它所关联的类别(类别)。
我所做的是:</p>
<pre><code> pro = [] #holds list of all the products
for p in pro:
for procat in p.get_categories():
print(procat)
</code></pre>
<p>但它返回错误:</p>
^{pr2}$
<p>我从这里得到了方法<a href="http://django-oscar.readthedocs.io/en/releases-1.3/_modules/oscar/apps/catalogue/abstract_models.html" rel="nofollow noreferrer">DJANGO OSCAR</a></p>