I have two models
class Sale(AuthorTimeStampedModel):
product = models.ManyToManyField(
Product, related_name='sale_product', null=True, blank=True)
def __str__(self):
return f"{self.id}"
class Product(AuthorTimeStampedModel):
id = models.IntegerField()
Now I want to apply query set to get all sales which have product_id 1 and 2
I am able to find Q function but it will result or condition but I want and condition