Vladimir Sidorenko

OR and AND without django.db.models.Q

, , django , querysets

I just found out that orand andare defined for QuerySet. This means that to do queries union or intersection, you can do:

User.objects.filter(...) | User.objects.filter(...)
    User.objects.filter(...) & User.objects.filter(...)
contact us right now