Topic.talks() -> Topic.talk_set

This commit is contained in:
Guilhem Saurel 2016-07-11 18:44:40 +02:00
parent c79181fe4b
commit 8fa2341ff6
2 changed files with 1 additions and 5 deletions

View File

@ -25,10 +25,6 @@ class Topic(PonyConfModel):
reviewers = models.ManyToManyField(User, blank=True)
@property
def talks(self):
return Talk.objects.filter(topics=self).all()
def __str__(self):
return self.name

View File

@ -15,7 +15,7 @@
{{ topic }}:
<a href="{% url 'edit-topic' topic.slug %}">{{ topic.reviewers.count }} reviewer{{ topic.reviewers.count|pluralize }}</a>
and
<a href="{{ topic.get_absolute_url }}">{{ topic.talks.count }} talk{{ topic.talks.count|pluralize }}</a>
<a href="{{ topic.get_absolute_url }}">{{ topic.talk_set.count }} talk{{ topic.talk_set.count|pluralize }}</a>
{% else %}
<a href="{{ topic.get_absolute_url }}">{{ topic }}</a>
{% endif %}