Fix issue 611: Proper (back)relationship on MediaComment.

well, fix the relationship on the comments.
This commit is contained in:
Elrond 2013-01-29 21:23:21 +01:00
parent e9b4e50007
commit ff68ca9fc2

View File

@ -393,7 +393,13 @@ class MediaComment(Base, MediaCommentMixin):
created = Column(DateTime, nullable=False, default=datetime.datetime.now)
content = Column(UnicodeText, nullable=False)
get_author = relationship(User)
# Cascade: Comments are owned by their creator. So do the full thing.
# lazy=dynamic: People might post a *lot* of comments, so make
# the "posted_comments" a query-like thing.
get_author = relationship(User,
backref=backref("posted_comments",
lazy="dynamic",
cascade="all, delete-orphan"))
class Collection(Base, CollectionMixin):