import django.db.models import Q code example Example: django import Q from django.db.models import Q