@property<EOL><INDENT>def can_publish(self):<DEDENT>
with self.published_context():<EOL><INDENT>published = self.one(<EOL>Q._uid == self._uid,<EOL>projection={'<STR_LIT>': True}<EOL>)<EOL><DEDENT>if not published:<EOL><INDENT>return True<EOL><DEDENT>with self.draft_context():<EOL><INDENT>draft = self.one(Q._uid == self._uid, projection={'<STR_LIT>': True})<EOL><DEDENT>return draft.revision > published.revision<EOL>
Return True if there is a draft version of the document that's ready to
be published.