The simple question is apologies if it is a duplicate, but I cannot find an answer if that is the case.
I have a user model and a presentation model, for example:
class Submission(models.Model):
uploaded_by = models.ForeignKey('User')
class User(models.Model):
name = models.CharField(max_length=250 )
How can I show the number of posts made by each user in the template ? I tried {{ user.submission.count }}for example:
for user in users:
{{ user.name }} ({{ user.submission.count }} submissions)
but no luck ...
AP257 source
share