I\'m my Django application I\'m fetching all the objects for a particular model like so:
secs = Sections.objects.filter(order__gt = 5)
I pa
As for a 2019 answer. I would suggest making use of related_name while making your ForeignKey to look like that:
related_name
ForeignKey
section = models.ForeignKey(Section, on_delete=models.SET_NULL, related_name='books')
Then you can use it as follows:
{{ section.books.count }}
or
{{ section.books|length }}