Re: Query involving manytomany relationship

2011-03-02 Thread gontran
I will answer to myself (after having been trying for over an hour, I found the answer a couple of minutes after posting my question) products = Product.objects.filter(productlicence__client=client).distinct() -- You received this message because you are subscribed to the Google Groups "Django

Re: Query involving manytomany relationship

2011-03-02 Thread gontran
Sorry for the question, but I've been trying for over an hour and just when I post this message, I find the answer!! Here is it: products = Product.objects.filter(productlicence__client=client).distinct() Hope that it will be useful -- You received this message because you are subscribed to the

Query involving manytomany relationship

2011-03-02 Thread gontran
Hello everybody this is maybe simple but I can't succeed in making a query. here is my model: class Client(models.Model): user= models.OneToOneField(User) product_licence= models.ManyToManyField('ProductLicence', blank=True, null=True) class ProductLicence(models.