I have following models:
class Product(models.Model):
name = CharField(max_length=30)
class Store(models.Model):
name = CharField(max_length=30)
product = models.ManyToManyField(Product)
How to get Store
s with product named product_name
and also, get all the products (except the product with name product_name
) ? Is it possible to make it in one query?
In raw SQL it would be simple JOIN
s. Not sure how to implement it via Django.