1from django.db.models import Q
2
3Q(question__startswith='Who') | Q(question__startswith='What')
4
1# Basic Django Q-filter
2
3from django.db.models import Q
4
5queryset.filter(Q(foo='bar') | Q(foo='baz'))
6
1from django.db.models import Q
2
3obj, created = Person.objects.filter(
4 Q(first_name='Bob') | Q(first_name='Robert'),
5).get_or_create(last_name='Marley', defaults={'first_name': 'Bob'})
6