django filter q and code example
Example 1: django q filter
# Basic Django Q-filter
from django.db.models import Q
queryset.filter(Q(foo='bar') | Q(foo='baz'))
Example 2: objects.filter django
>>> Entry.objects.filter(blog_id=4)
# Basic Django Q-filter
from django.db.models import Q
queryset.filter(Q(foo='bar') | Q(foo='baz'))
>>> Entry.objects.filter(blog_id=4)