equal
deleted
inserted
replaced
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.moves import range |
71 from six.moves import range |
71 |
72 |
72 from logilab.mtconverter import xml_escape |
73 from logilab.mtconverter import xml_escape |
73 from logilab.common.decorators import cachedproperty |
74 from logilab.common.decorators import cachedproperty |
74 from logilab.common.deprecation import class_deprecated |
75 from logilab.common.deprecation import class_deprecated |
284 |
285 |
285 def cell_attributes(self, rownum, _colnum, renderer): |
286 def cell_attributes(self, rownum, _colnum, renderer): |
286 attrs = renderer.attributes.copy() |
287 attrs = renderer.attributes.copy() |
287 if renderer.sortable: |
288 if renderer.sortable: |
288 sortvalue = renderer.sortvalue(rownum) |
289 sortvalue = renderer.sortvalue(rownum) |
289 if isinstance(sortvalue, basestring): |
290 if isinstance(sortvalue, string_types): |
290 sortvalue = sortvalue[:self.sortvalue_limit] |
291 sortvalue = sortvalue[:self.sortvalue_limit] |
291 if sortvalue is not None: |
292 if sortvalue is not None: |
292 attrs[u'cubicweb:sortvalue'] = js_dumps(sortvalue) |
293 attrs[u'cubicweb:sortvalue'] = js_dumps(sortvalue) |
293 return attrs |
294 return attrs |
294 |
295 |