equal
deleted
inserted
replaced
16 # You should have received a copy of the GNU Lesser General Public License along |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """Basic views for python values (eg without any result set) |
18 """Basic views for python values (eg without any result set) |
19 """ |
19 """ |
20 |
20 |
21 |
|
22 from six import text_type |
|
23 from six.moves import range |
|
24 |
|
25 from cubicweb.view import View |
21 from cubicweb.view import View |
26 from cubicweb.predicates import match_kwargs |
22 from cubicweb.predicates import match_kwargs |
27 from cubicweb.web.views import tableview |
23 from cubicweb.web.views import tableview |
28 |
24 |
29 |
25 |
39 w(self._cw._(self.header)) |
35 w(self._cw._(self.header)) |
40 else: |
36 else: |
41 w(self.empty_cell_content) |
37 w(self.empty_cell_content) |
42 |
38 |
43 def render_cell(self, w, rownum): |
39 def render_cell(self, w, rownum): |
44 w(text_type(self.data[rownum][self.colid])) |
40 w(str(self.data[rownum][self.colid])) |
45 |
41 |
46 |
42 |
47 class PyValTableView(tableview.TableMixIn, View): |
43 class PyValTableView(tableview.TableMixIn, View): |
48 """This table view is designed to be used a list of list of unicode values |
44 """This table view is designed to be used a list of list of unicode values |
49 given as a mandatory `pyvalue` argument. Take care, content is NOT |
45 given as a mandatory `pyvalue` argument. Take care, content is NOT |