Merge branch 'dev' into preprod

This commit is contained in:
Darks 2020-07-23 20:19:18 +02:00
commit 07a5ee4006
Signed by: Darks
GPG Key ID: F61F10FA138E797C
2 changed files with 5 additions and 2 deletions

View File

@ -32,7 +32,8 @@ class User(UserMixin, db.Model):
# User type (polymorphic discriminator)
type = db.Column(db.String(30))
# Also a [posts] relationship populated from the Post class.
# Other fields populated automatically through relations:
# <posts> relationship populated from the Post class.
__mapper_args__ = {
'polymorphic_identity': __tablename__,
@ -106,6 +107,8 @@ class Member(User):
# Relations
trophies = db.relationship('Trophy', secondary=TrophyMember,
back_populates='owners')
topics = db.relationship('Topic')
comments = db.relationship('Comment')
# Displayed title
# title_id = db.Column(db.Integer, db.ForeignKey('title.id'))

View File

@ -69,7 +69,7 @@
<th>Création</th>
<th>Commentaires</th>
</tr>
{% for t in member.posts if t.type == "topic" %}
{% for t in member.topics %}
<tr>
<td><a href="{{ url_for('forum_topic', f=t.forum, page=(t, 1)) }}">{{ t.title }}</a></td>
<td><a href="{{ url_for('forum_page', f=t.forum) }}">{{ t.forum.name }}</a></td>