remove some warnings
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 19 Oct 2009 17:49:26 +0200
changeset 3729 e4f20b74af51
parent 3728 c23add03ff4d
child 3730 d6f95bd1032d
remove some warnings
web/uicfg.py
web/views/tableview.py
--- a/web/uicfg.py	Mon Oct 19 17:42:47 2009 +0200
+++ b/web/uicfg.py	Mon Oct 19 17:49:26 2009 +0200
@@ -275,7 +275,7 @@
             sectdict.setdefault('inlined', 'hidden')
         # ensure we have a tag for each form type
         if not 'main' in sectdict:
-            if not rschema.is_final() and (
+            if not rschema.final and (
                 sectdict.get('inlined') == 'attributes' or
                 'inlined_attributes' in self.init_get(sschema, rschema, oschema,
                                                       neg_role(role))):
@@ -288,7 +288,7 @@
                     sectdict['main'] = 'attributes'
                     if not 'muledit' in sectdict:
                         sectdict['muledit'] = 'attributes'
-                elif rschema.is_final():
+                elif rschema.final:
                     sectdict['main'] = 'attributes'
                 else:
                     sectdict['main'] = 'relations'
@@ -370,7 +370,7 @@
                 if eid is None and '%s_on_new' % permission in permsoverrides.etype_get(eschema, rschema, role):
                     yield (rschema, targetschemas, role)
                     continue
-                if rschema.is_final():
+                if rschema.final:
                     if not rschema.has_perm(entity._cw, permission, eid):
                         continue
                 elif role == 'subject':
--- a/web/views/tableview.py	Mon Oct 19 17:42:47 2009 +0200
+++ b/web/views/tableview.py	Mon Oct 19 17:49:26 2009 +0200
@@ -193,6 +193,7 @@
     def get_columns(self, computed_labels, displaycols, headers, subvid,
                     cellvids, cellattrs, mainindex):
         columns = []
+        eschema = self._cw.vreg.schema.eschema
         for colindex, label in enumerate(computed_labels):
             if colindex not in displaycols:
                 continue
@@ -207,7 +208,7 @@
             # join, use the default non final subvid)
             if cellvids and colindex in cellvids:
                 column.append_renderer(cellvids[colindex], colindex)
-            elif coltype is not None and self._cw.schema.eschema(coltype).final:
+            elif coltype is not None and eschema(coltype).final:
                 column.append_renderer(self.finalview, colindex)
             else:
                 column.append_renderer(subvid or 'incontext', colindex)
@@ -236,7 +237,7 @@
         if val is None:
             return u''
         etype = self.cw_rset.description[row][col]
-        if self._cw.schema.eschema(etype).final:
+        if self._cw.vreg.schema.eschema(etype).final:
             entity, rtype = self.cw_rset.related_entity(row, col)
             if entity is None:
                 return val # remove_html_tags() ?