Skip to content
Snippets Groups Projects
hooks.py 490 B
Newer Older
from cubicweb.selectors import implements, is_in_state
from cubicweb.sobjects.notification import NotificationView, StatusChangeMixIn
class BlogEntryPublishedView(StatusChangeMixIn, NotificationView):
    """get notified from published blogs"""
    __select__ = implements('BlogEntry',) & is_in_state('published')
Nicolas Chauvat's avatar
Nicolas Chauvat committed
    content_attr = 'content'
Arthur Lutz's avatar
Arthur Lutz committed
        entity = self.cw_rset.get_entity(0, 0)
        return '[%s] %s' % (self._cw.vreg.config.appid, entity.dc_title())