【发布时间】:2015-03-27 21:25:48
【问题描述】:
我正在运行 Django 1.7,并且在尝试执行以下操作时收到 TypeError: unsupported operand type(s) for |: 'bool' and 'Q':
class PersonList(generic.ListView):
template_name = "persons/list.html"
model = Person
queryset = Person.objects.filter(Q(field1__isnull=True | Q(field2__isnull=True)))
【问题讨论】: