admin: fixed the forum panel
This commit is contained in:
parent
ed5367d46d
commit
e265e003b9
|
@ -38,7 +38,8 @@ class Forum(db.Model):
|
|||
|
||||
def post_count(self):
|
||||
"""Number of posts in every topic of the forum, without subforums."""
|
||||
return sum(len(t.thread.comments) for t in self.topics)
|
||||
# TODO: optimize this with real ORM
|
||||
return sum(t.thread.comments.count() for t in self.topics)
|
||||
|
||||
def __repr__(self):
|
||||
return f'<Forum: {self.name}>'
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<td style='padding-left: {{ 6+24*level }}px'>
|
||||
<a href='/forum{{ f.url }}'>{{ f.name }}</a>
|
||||
</td>
|
||||
<td>{{ f.topics | length }}</td>
|
||||
<td>{{ f.topics.count() }}</td>
|
||||
<td>{{ f.post_count() }}</td>
|
||||
</tr>
|
||||
|
||||
|
|
Loading…
Reference in New Issue