특정 오브젝트를 필터를 사용하여 추출하기(Retrieving specific objects with filters)

filter

Entry.objects.filter(pub_date__year=2006)

exclude

q = Entry.objects.filter(headline__startswith="What")
q = q.filter(pub_date__lte=datetime.date.today())
q = q.exclude(body_text__icontains="food")

필터 체이닝

Entry.objects.filter(headline__startswith='What').exclude(pub_date__gte=datetime.date.today()
).filter(pub_date__gte=datetime.date(2005, 1, 30))