devtools/test/data/views.py
author Alexandre Fayolle <alexandre.fayolle@logilab.fr>
Tue, 06 Apr 2010 19:42:37 +0200
branchstable
changeset 5168 1ab032df5ca3
parent 4470 34f57659f90e
child 5421 8167de96c523
permissions -rw-r--r--
SQL Server port: temporary table handling Together with support from logilab.database, handle temp tables for SQLServer (which are denoted by a name starting with '#', just don't ask) Note updated dependency on logilab.database 1.0.2

"""only for unit tests !

:organization: Logilab
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
"""

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

HTML_PAGE = u"""<html>
  <body>
    <h1>Hello World !</h1>
  </body>
</html>
"""

class SimpleView(EntityView):
    __regid__ = 'simple'
    __select__ = implements('Bug',)

    def call(self, **kwargs):
        self.cell_call(0, 0)

    def cell_call(self, row, col):
        self.w(HTML_PAGE)

class RaisingView(EntityView):
    __regid__ = 'raising'
    __select__ = implements('Bug',)

    def cell_call(self, row, col):
        raise ValueError()