1Just adding this for multiple filters attaching to Q object, if someone might be looking to it. If a Q object is provided, it must precede the definition of any keyword arguments. Otherwise its an invalid query. You should be careful when doing it.
2
3an example would be
4
5from django.db.models import Q
6User.objects.filter(Q(income__gte=5000) | Q(income__isnull=True),category='income')
7
8Here the OR condition and a filter with category of income is taken into account