equal
deleted
inserted
replaced
23 from itertools import cycle |
23 from itertools import cycle |
24 |
24 |
25 import tempfile |
25 import tempfile |
26 import os, os.path as osp |
26 import os, os.path as osp |
27 import codecs |
27 import codecs |
|
28 |
|
29 from six import text_type |
28 |
30 |
29 from logilab.common.graph import GraphGenerator, DotBackend |
31 from logilab.common.graph import GraphGenerator, DotBackend |
30 from logilab.common.ureports import Section, Table |
32 from logilab.common.ureports import Section, Table |
31 from logilab.common.registry import yes |
33 from logilab.common.registry import yes |
32 from logilab.mtconverter import xml_escape |
34 from logilab.mtconverter import xml_escape |
277 __regid__ = 'etype-attr-defaultval-cell' |
279 __regid__ = 'etype-attr-defaultval-cell' |
278 |
280 |
279 def cell_call(self, row, col): |
281 def cell_call(self, row, col): |
280 defaultval = self.cw_rset.rows[row][col] |
282 defaultval = self.cw_rset.rows[row][col] |
281 if defaultval is not None: |
283 if defaultval is not None: |
282 self.w(unicode(self.cw_rset.rows[row][col].unzpickle())) |
284 self.w(text_type(self.cw_rset.rows[row][col].unzpickle())) |
283 |
285 |
284 class CWETypeRelationCardinalityCell(baseviews.FinalView): |
286 class CWETypeRelationCardinalityCell(baseviews.FinalView): |
285 __regid__ = 'etype-rel-cardinality-cell' |
287 __regid__ = 'etype-rel-cardinality-cell' |
286 |
288 |
287 def cell_call(self, row, col): |
289 def cell_call(self, row, col): |
485 |
487 |
486 def cell_call(self, row, col): |
488 def cell_call(self, row, col): |
487 entity = self.cw_rset.get_entity(row, col) |
489 entity = self.cw_rset.get_entity(row, col) |
488 rschema = self._cw.vreg.schema.rschema(entity.rtype.name) |
490 rschema = self._cw.vreg.schema.rschema(entity.rtype.name) |
489 rdef = rschema.rdefs[(entity.stype.name, entity.otype.name)] |
491 rdef = rschema.rdefs[(entity.stype.name, entity.otype.name)] |
490 constraints = [xml_escape(unicode(c)) for c in getattr(rdef, 'constraints')] |
492 constraints = [xml_escape(text_type(c)) for c in getattr(rdef, 'constraints')] |
491 self.w(u'<br/>'.join(constraints)) |
493 self.w(u'<br/>'.join(constraints)) |
492 |
494 |
493 class CWAttributeOptionsCell(EntityView): |
495 class CWAttributeOptionsCell(EntityView): |
494 __regid__ = 'rdef-options-cell' |
496 __regid__ = 'rdef-options-cell' |
495 __select__ = is_instance('CWAttribute') |
497 __select__ = is_instance('CWAttribute') |