web/views/tableview.py
changeset 10688 fa29f3628a1b
parent 10686 a08d5a657836
child 10718 97d398e17f8c
equal deleted inserted replaced
10687:d394bfcd8c25 10688:fa29f3628a1b
    65 
    65 
    66 from warnings import warn
    66 from warnings import warn
    67 from copy import copy
    67 from copy import copy
    68 from types import MethodType
    68 from types import MethodType
    69 
    69 
    70 from six import string_types
    70 from six import string_types, add_metaclass
    71 from six.moves import range
    71 from six.moves import range
    72 
    72 
    73 from logilab.mtconverter import xml_escape
    73 from logilab.mtconverter import xml_escape
    74 from logilab.common.decorators import cachedproperty
    74 from logilab.common.decorators import cachedproperty
    75 from logilab.common.deprecation import class_deprecated
    75 from logilab.common.deprecation import class_deprecated
   919 ################################################################################
   919 ################################################################################
   920 # DEPRECATED tables ############################################################
   920 # DEPRECATED tables ############################################################
   921 ################################################################################
   921 ################################################################################
   922 
   922 
   923 
   923 
       
   924 @add_metaclass(class_deprecated)
   924 class TableView(AnyRsetView):
   925 class TableView(AnyRsetView):
   925     """The table view accepts any non-empty rset. It uses introspection on the
   926     """The table view accepts any non-empty rset. It uses introspection on the
   926     result set to compute column names and the proper way to display the cells.
   927     result set to compute column names and the proper way to display the cells.
   927 
   928 
   928     It is however highly configurable and accepts a wealth of options.
   929     It is however highly configurable and accepts a wealth of options.
   929     """
   930     """
   930     __metaclass__ = class_deprecated
       
   931     __deprecation_warning__ = '[3.14] %(cls)s is deprecated'
   931     __deprecation_warning__ = '[3.14] %(cls)s is deprecated'
   932     __regid__ = 'table'
   932     __regid__ = 'table'
   933     title = _('table')
   933     title = _('table')
   934     finalview = 'final'
   934     finalview = 'final'
   935 
   935 
  1185     __regid__ = 'editable-table'
  1185     __regid__ = 'editable-table'
  1186     finalview = 'editable-final'
  1186     finalview = 'editable-final'
  1187     title = _('editable-table')
  1187     title = _('editable-table')
  1188 
  1188 
  1189 
  1189 
       
  1190 @add_metaclass(class_deprecated)
  1190 class CellView(EntityView):
  1191 class CellView(EntityView):
  1191     __metaclass__ = class_deprecated
       
  1192     __deprecation_warning__ = '[3.14] %(cls)s is deprecated'
  1192     __deprecation_warning__ = '[3.14] %(cls)s is deprecated'
  1193     __regid__ = 'cell'
  1193     __regid__ = 'cell'
  1194     __select__ = nonempty_rset()
  1194     __select__ = nonempty_rset()
  1195 
  1195 
  1196     def cell_call(self, row, col, cellvid=None):
  1196     def cell_call(self, row, col, cellvid=None):
  1272 class EditableInitialTableTableView(InitialTableView):
  1272 class EditableInitialTableTableView(InitialTableView):
  1273     __regid__ = 'editable-initialtable'
  1273     __regid__ = 'editable-initialtable'
  1274     finalview = 'editable-final'
  1274     finalview = 'editable-final'
  1275 
  1275 
  1276 
  1276 
       
  1277 @add_metaclass(class_deprecated)
  1277 class EntityAttributesTableView(EntityView):
  1278 class EntityAttributesTableView(EntityView):
  1278     """This table displays entity attributes in a table and allow to set a
  1279     """This table displays entity attributes in a table and allow to set a
  1279     specific method to help building cell content for each attribute as well as
  1280     specific method to help building cell content for each attribute as well as
  1280     column header.
  1281     column header.
  1281 
  1282 
  1283     methods if defined otherwise cell content will be entity.COLNAME.
  1284     methods if defined otherwise cell content will be entity.COLNAME.
  1284 
  1285 
  1285     Table will render column header using the method header_for_COLNAME if
  1286     Table will render column header using the method header_for_COLNAME if
  1286     defined otherwise COLNAME will be used.
  1287     defined otherwise COLNAME will be used.
  1287     """
  1288     """
  1288     __metaclass__ = class_deprecated
       
  1289     __deprecation_warning__ = '[3.14] %(cls)s is deprecated'
  1289     __deprecation_warning__ = '[3.14] %(cls)s is deprecated'
  1290     __abstract__ = True
  1290     __abstract__ = True
  1291     columns = ()
  1291     columns = ()
  1292     table_css = "listing"
  1292     table_css = "listing"
  1293     css_files = ()
  1293     css_files = ()