Re: Q() chaining with & returns empty set

2016-04-22 Thread Peter of the Norse
They talk about this in the documentation. https://docs.djangoproject.com/en/1.8/topics/db/queries/#spanning-multi-valued-relationships Anything in a single filter() involves the same object. For example, if you wanted to find all baskets containing a three pound banana, you would do

Re: Q() chaining with & returns empty set

2016-04-01 Thread Erik Cederstrand
> Den 31. mar. 2016 kl. 04.14 skrev Bai Shun : > > I've got a problem in using Q() To see what's going on, try to print the SQL that Django generates for working and non-working queryset: > print >

Q() chaining with & returns empty set

2016-03-31 Thread Bai Shun
I've got a problem in using Q() http://stackoverflow.com/questions/36299975/query-q-is-not-working-as-set-contain-for-related-field-in-django Let's say we have baskets of fruits. How to filter out those baskets that contains all fruits in a given basket? In this document