@classmethod
def __declare_last__(cls):
    cls.entries = db.relationship(Entry, viewonly=True)

def attach_entries(self, entries):
    """Attach Entries To This Post.
        Example:
            >>> post = Post("An Interesting News", "Wow !!!")
            >>> text_entry = TextEntry(*t_args)
            >>> photo_entry = PhotoEntry(*p_args)
            >>> post.attach_entries([text_entry, photo_entry])
            >>> len(post.entries)
            2
            >>> db.session.commit()
            >>>
        """
for entry in entries:
    self.entries.append(entry)
entry.post = self
db.session.add(entry)
SQLAlchemy Polymorphic Relationship with Concrete Inheritance