First example:
# ANDing Q objects q_object = Q() q_object.add(Q(), Q.AND)
Second example:
>>> import operator
This method can be very useful for creating queries for pages with conditional filters, for example, on eBay.
But this, as I know, is not documented, so what are the best practices for this issue that will not be removed from support and will not confuse people who will read my code?
ps
And also - is this a good solution for using the "&" operator with Q () objects? In Django docs, I haven't found anything about this!
source share