1# Returns the total number of entries in the database.
2count = Entry.objects.count()
3
4# Returns the number of entries whose headline contains 'Lennon'
5count = Entry.objects.filter(headline__contains='Lennon').count()
6
1>>> Entry.objects.filter(
2... headline__startswith='What'
3... ).exclude(
4... pub_date__gte=datetime.date.today()
5... ).filter(
6... pub_date__gte=datetime.date(2005, 1, 30)
7... )
8