get all data from database in django code example
Example 1: django filter on related field
len(Collection.objects.filter(item__flag=True).distinct())
Example 2: django swlite queries
>>> Entry.objects.filter(pub_date__lte='2006-01-01')
len(Collection.objects.filter(item__flag=True).distinct())
>>> Entry.objects.filter(pub_date__lte='2006-01-01')