program: fix tag assignment
This commit is contained in:
parent
011ea3d2a6
commit
0e1b434f7d
|
@ -21,6 +21,9 @@ class Post(db.Model):
|
|||
index=True)
|
||||
author = db.relationship('User', backref="posts", foreign_keys=author_id)
|
||||
|
||||
# Tags, for programs and tutorials
|
||||
tags = db.relationship('Tag', back_populates='post', lazy='joined')
|
||||
|
||||
__mapper_args__ = {
|
||||
'polymorphic_identity': __tablename__,
|
||||
'polymorphic_on': type
|
||||
|
|
|
@ -12,15 +12,12 @@ class Program(Post):
|
|||
title = db.Column(db.Unicode(128))
|
||||
|
||||
# TODO: Category (games/utilities/lessons)
|
||||
# TODO: Tags
|
||||
# TODO: Compatible calculator models
|
||||
|
||||
thread_id = db.Column(db.Integer,db.ForeignKey('thread.id'),nullable=False)
|
||||
thread = db.relationship('Thread', foreign_keys=thread_id,
|
||||
back_populates='owner_program')
|
||||
|
||||
tags = db.relationship('Tag', back_populates='post', lazy='joined')
|
||||
|
||||
# TODO: Number of views, statistics, attached files, etc
|
||||
|
||||
def __init__(self, author, title, thread):
|
||||
|
|
Loading…
Reference in New Issue