Python - How to import 'Q' -- django

Import Q

To import Q, Add the following line to the top of your code.

from django.db.models import Q

 

For more information about Q:
django Q