Retrieve Django ManyToMany results outside of the current model <p>Hi I'm brand new to Django.</p> <ul> <li>I have a list of <strong>stores</strong>. Each of those stores carry <strong>brands</strong> of products.</li> <li>For a store, I can list the brands that they carry. </li> <li><strong>For a brand, I want to list the stores that carry that brand.</strong></li> </ul> <p>Here are my models (simplified):</p> <pre><code>class Store(models.Model): company = models.CharField(max_length=256) brands = models.ManyToManyField('Brand',related_name='brand') class Brand(models.Model): company = models.CharField(max_length=256) </code></pre> <p>Here is my view for the template:</p> <pre><code>def brand_detail_slug(request, slug): brand = Brand.objects.get(slug=slug) return render(request, 'storefinder/brand_detail.html', {'brand': brand}) </code></pre> <hr> <p>I can retrieve info for the brands successfully in my view:</p> <pre><code>{% for p in brand.product_types.all %} &lt;li&gt;{{ p }}&lt;/li&gt; {% endfor %} </code></pre> <p>But I don't know how to do this for stores, since it's not really defined in the Brands. It's a separate model.... this is where I get confused.</p> <p>Thanks!</p>