Beispiel #1
0
 def unpublish(self):
     """
     Withdraw the published version and go back to being a draft.
     """
     self.revisions.published = None
     revision = ContentRevision.query.filter_by(parent=self.revisions).order_by(db.desc('id')).limit(1).first()
     self.revisions.draft = revision
     self.title = revision.title
     self.is_published = False
Beispiel #2
0
def feedquery():
    return Post.query.filter_by(is_published=True).order_by(db.desc('node.published_at'))
Beispiel #3
0
 def last_revision(self):
     revision = self.revisions.draft or self.revisions.published
     if revision is None:
         revision = ContentRevision.query.filter_by(parent=self.revisions).order_by(db.desc('id')).limit(1).first()
     return revision
Beispiel #4
0
def feedquery():
    return Post.query.filter_by(is_published=True).order_by(
        db.desc('node.published_at'))