web/views/wfentities.py
author sylvain.thenault@logilab.fr
Wed, 18 Feb 2009 18:06:41 +0100
branchtls-sprint
changeset 822 e3d8db01f3f5
parent 795 63f4f81e19f1
child 984 536e421b082b
permissions -rw-r--r--
test_views fixes

"""html view for workflow related entities

:organization: Logilab
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
"""
__docformat__ = "restructuredtext en"

from logilab.mtconverter import html_escape

from cubicweb.selectors import implements
from cubicweb.common.view import EntityView

class CellView(EntityView):
    id = 'cell'
    __select__ = implements('TrInfo')
    
    def cell_call(self, row, col, cellvid=None):
        entity = self.entity(row, col)
        self.w(entity.printable_value('comment'))


class StateInContextView(EntityView):
    """convenience trick, State's incontext view should not be clickable"""
    id = 'incontext'
    __select__ = implements('State')
    
    def cell_call(self, row, col):
        self.w(html_escape(self.view('textincontext', self.rset,
                                     row=row, col=col)))