Source

crosswiki / crosswiki / models.py

Full commit
from docutils.core import publish_parts
import sqlalchemy as sa
import sqlahelper

Base = sqlahelper.get_base()
DBSession = sqlahelper.get_session()

class Page(Base):
    __tablename__ = 'pages'
    id = sa.Column(sa.Integer, primary_key=True)
    page_name = sa.Column(sa.Unicode(255), unique=True)
    content = sa.Column(sa.UnicodeText)

    @property
    def html_content(self):

        parts = publish_parts(source=self.content,
            writer_name='html')
        return parts['html_body']