1from django.db.models import Q
2
3Q(question__startswith='Who') | Q(question__startswith='What')
4
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
1# Get blogs entries with id 1, 4 and 7
2>>> Blog.objects.filter(pk__in=[1,4,7])
3
4# Get all blog entries with id > 14
5>>> Blog.objects.filter(pk__gt=14)
6