django get all objects excluding columns code example
Example 1: django filter on related field
len(Collection.objects.filter(item__flag=True).distinct())
Example 2: django get item by id
obj = Class.objects.get(pk=this_object_id)
len(Collection.objects.filter(item__flag=True).distinct())
obj = Class.objects.get(pk=this_object_id)