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
def feedquery(): return Post.query.filter_by(is_published=True).order_by(db.desc('node.published_at'))
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
def feedquery(): return Post.query.filter_by(is_published=True).order_by( db.desc('node.published_at'))