Topic.talks() -> Topic.talk_set
This commit is contained in:
parent
c79181fe4b
commit
8fa2341ff6
|
@ -25,10 +25,6 @@ class Topic(PonyConfModel):
|
||||||
|
|
||||||
reviewers = models.ManyToManyField(User, blank=True)
|
reviewers = models.ManyToManyField(User, blank=True)
|
||||||
|
|
||||||
@property
|
|
||||||
def talks(self):
|
|
||||||
return Talk.objects.filter(topics=self).all()
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
{{ topic }}:
|
{{ topic }}:
|
||||||
<a href="{% url 'edit-topic' topic.slug %}">{{ topic.reviewers.count }} reviewer{{ topic.reviewers.count|pluralize }}</a>
|
<a href="{% url 'edit-topic' topic.slug %}">{{ topic.reviewers.count }} reviewer{{ topic.reviewers.count|pluralize }}</a>
|
||||||
and
|
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 %}
|
{% else %}
|
||||||
<a href="{{ topic.get_absolute_url }}">{{ topic }}</a>
|
<a href="{{ topic.get_absolute_url }}">{{ topic }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user