some cw 3.6 api update
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 08 Dec 2009 09:10:39 +0100
changeset 4015 4f8235204dda
parent 4014 24f7d7eb4c23
child 4016 250784a2d105
some cw 3.6 api update
test/unittest_entity.py
web/uicfg.py
web/views/autoform.py
--- a/test/unittest_entity.py	Tue Dec 08 09:10:16 2009 +0100
+++ b/test/unittest_entity.py	Tue Dec 08 09:10:39 2009 +0100
@@ -405,7 +405,7 @@
         e['data_name'] = 'an html file'
         e['data_format'] = 'text/html'
         e['data_encoding'] = 'ascii'
-        e.req.transaction_data = {} # XXX req should be a session
+        e._cw.transaction_data = {} # XXX req should be a session
         self.assertEquals(set(e.get_words()),
                           set(['an', 'html', 'file', 'du', 'html', 'some', 'data']))
 
--- a/web/uicfg.py	Tue Dec 08 09:10:16 2009 +0100
+++ b/web/uicfg.py	Tue Dec 08 09:10:39 2009 +0100
@@ -360,7 +360,7 @@
                     continue
                 rdef = rschema.role_rdef(eschema, tschema, role)
                 if not ((not strict and rdef.has_local_role(permission)) or
-                        rdef.has_perm(entity.req, permission, fromeid=eid)):
+                        rdef.has_perm(entity._cw, permission, fromeid=eid)):
                     continue
                 _targetschemas.append(tschema)
             if not _targetschemas:
--- a/web/views/autoform.py	Tue Dec 08 09:10:16 2009 +0100
+++ b/web/views/autoform.py	Tue Dec 08 09:10:39 2009 +0100
@@ -59,9 +59,9 @@
         try:
             return super(AutomaticEntityForm, cls_or_self).field_by_name(name, role)
         except form.FieldNotFound:
-            if eschema is None or not name in cls_or_self._cw.schema:
+            if eschema is None or not name in cls_or_self._cw.vreg.schema:
                 raise
-            rschema = cls_or_self._cw.schema.rschema(name)
+            rschema = cls_or_self._cw.vreg.schema.rschema(name)
             # XXX use a sample target type. Document this.
             tschemas = rschema.targets(eschema, role)
             fieldcls = cls_or_self.rfields.etype_get(eschema, rschema, role,