talks count for each speakers

This commit is contained in:
Élie Bouttier 2016-07-12 19:47:26 +02:00
parent 5b2ec5546a
commit c13bc08588
2 changed files with 8 additions and 1 deletions

View File

@ -78,3 +78,7 @@ class Participation(PonyConfModel):
@property
def topic_set(self):
return self.user.topic_set.filter(site=self.site)
@property
def talk_set(self):
return self.user.talk_set.filter(site=self.site)

View File

@ -8,7 +8,10 @@
<ul>
{% for speaker in user_list %}
<li><a href="{% url 'show-speaker' username=speaker.username %}">{{ speaker.profile }}</a></li>
<li>
<a href="{% url 'show-speaker' username=speaker.username %}">{{ speaker.profile }}</a>
({{ speaker.talk_set.count }} talk{{ speaker.talk_set.count|pluralize }})
</li>
{% empty %}
<li><i>No speakers.</i></li>
{% endfor %}