cubicweb/web/views/tableview.py
changeset 12542 85194bd49119
parent 12503 b01dd0ef43aa
child 12567 26744ad37953
equal deleted inserted replaced
12541:bbbccb0b3a66 12542:85194bd49119
    61 """
    61 """
    62 
    62 
    63 
    63 
    64 from cubicweb import _
    64 from cubicweb import _
    65 
    65 
    66 from warnings import warn
       
    67 from copy import copy
    66 from copy import copy
    68 from types import MethodType
    67 from types import MethodType
    69 
    68 
    70 from six import string_types, add_metaclass, create_bound_method
    69 from six import string_types, add_metaclass, create_bound_method
    71 from six.moves import range
    70 from six.moves import range
   603         # since they depends on a particular shape (being linkable meaning view
   602         # since they depends on a particular shape (being linkable meaning view
   604         # may be listed in possible views
   603         # may be listed in possible views
   605         return self.__regid__ == 'table'
   604         return self.__regid__ == 'table'
   606 
   605 
   607     def call(self, headers=None, displaycols=None, cellvids=None,
   606     def call(self, headers=None, displaycols=None, cellvids=None,
   608              paginate=None, **kwargs):
   607              paginate=None):
   609         if self.headers:
   608         if self.headers:
   610             self.headers = [h and self._cw._(h) for h in self.headers]
   609             self.headers = [h and self._cw._(h) for h in self.headers]
   611         if (headers or displaycols or cellvids or paginate):
   610         if (headers or displaycols or cellvids or paginate):
   612             if headers is not None:
   611             if headers is not None:
   613                 self.headers = headers
   612                 self.headers = headers
   615                 self.displaycols = displaycols
   614                 self.displaycols = displaycols
   616             if cellvids is not None:
   615             if cellvids is not None:
   617                 self.cellvids = cellvids
   616                 self.cellvids = cellvids
   618             if paginate is not None:
   617             if paginate is not None:
   619                 self.paginable = paginate
   618                 self.paginable = paginate
   620         if kwargs:
   619         super(RsetTableView, self).call()
   621             # old table view arguments that we can safely ignore thanks to
       
   622             # selectors
       
   623             if len(kwargs) > 1:
       
   624                 msg = '[3.14] %s arguments are deprecated' % ', '.join(kwargs)
       
   625             else:
       
   626                 msg = '[3.14] %s argument is deprecated' % ', '.join(kwargs)
       
   627             warn(msg, DeprecationWarning, stacklevel=2)
       
   628         super(RsetTableView, self).call(**kwargs)
       
   629 
   620 
   630     def main_var_index(self):
   621     def main_var_index(self):
   631         """returns the index of the first non-attribute variable among the RQL
   622         """returns the index of the first non-attribute variable among the RQL
   632         selected variables
   623         selected variables
   633         """
   624         """