Is there a way to take a list of django query expresses (e.g. Q(first_name=\"Jordan\"), where Q is django.db.models.Q) and bitwise OR
Q(first_name=\"Jordan\")
Q
django.db.models.Q
You probably want
import operator from functools import reduce # Python 3 search_params = reduce(operator.or_, search_params, Q())
This will place a bit-wise or (|) between all the items in search_params, starting with an empty condition Q().
|
search_params
Q()