cw 3.6 api update
authorSandrine Ribeau <sandrine.ribeau@logilab.fr>
Wed, 09 Dec 2009 12:23:31 +0100
changeset 4073 03681ba6da0b
parent 4071 e19e586cc74e
child 4074 9cce43f52c61
cw 3.6 api update
web/facet.py
web/views/editcontroller.py
web/views/formrenderers.py
web/views/navigation.py
web/views/owl.py
web/views/primary.py
--- a/web/facet.py	Wed Dec 09 12:20:05 2009 +0100
+++ b/web/facet.py	Wed Dec 09 12:23:31 2009 +0100
@@ -109,8 +109,8 @@
     if rel.optional in (opt, 'both'):
         # optional relation
         return ovar
-    if all(rschema.rproperty(s, o, 'cardinality')[cardidx] in '1+'
-           for s,o in rschema.iter_rdefs()):
+    if all(rdef.cardinality[cardidx] in '1+'
+           for rdef in rschema.rdefs.values()):
         # mandatory relation without any restriction on the other variable
         for orel in ovar.stinfo['relations']:
             if rel is orel:
--- a/web/views/editcontroller.py	Wed Dec 09 12:20:05 2009 +0100
+++ b/web/views/editcontroller.py	Wed Dec 09 12:23:31 2009 +0100
@@ -166,7 +166,7 @@
             toinsert = self._cw.list_form_param('__insert', formparams, pop=True)
             self.insert_relations(parse_relations_descr(toinsert))
         if is_main_entity: # only execute linkto for the main entity
-            self.execute_linkto(eid)
+            self.execute_linkto(entity.eid)
         return eid
 
     def handle_formfield(self, form, field, entity, rqlquery):
--- a/web/views/formrenderers.py	Wed Dec 09 12:20:05 2009 +0100
+++ b/web/views/formrenderers.py	Wed Dec 09 12:23:31 2009 +0100
@@ -362,7 +362,7 @@
         attrs_fs_label = ''
         if self.main_form_title:
             attrs_fs_label += ('<div class="iformTitle"><span>%s</span></div>'
-                               % self.req._(self.main_form_title))
+                               % self._cw._(self.main_form_title))
         attrs_fs_label += '<div class="formBody">'
         return attrs_fs_label + super(EntityFormRenderer, self).open_form(form, values)
 
--- a/web/views/navigation.py	Wed Dec 09 12:20:05 2009 +0100
+++ b/web/views/navigation.py	Wed Dec 09 12:23:31 2009 +0100
@@ -174,8 +174,8 @@
 
 def paginate(view, show_all_option=True, w=None, page_size=None, rset=None):
     if rset is None:
-        rset = view.rset
-    limit_rset_using_paged_nav(view, view.req, rset, w or view.w,
+        rset = view.cw_rset
+    limit_rset_using_paged_nav(view, view._cw, rset, w or view.w,
                                not view.need_navigation, show_all_option,
                                page_size=page_size)
 View.paginate = paginate
--- a/web/views/owl.py	Wed Dec 09 12:20:05 2009 +0100
+++ b/web/views/owl.py	Wed Dec 09 12:23:31 2009 +0100
@@ -191,7 +191,7 @@
                 continue
             for tschema in targetschemas:
                 rdef = rschema.role_rdef(eschema, tschema, role)
-                if rdef.may_have_permission('read', self.req):
+                if rdef.may_have_permission('read', self._cw):
                     break
             else:
                 # no read perms to any relation of this type. Skip.
--- a/web/views/primary.py	Wed Dec 09 12:20:05 2009 +0100
+++ b/web/views/primary.py	Wed Dec 09 12:23:31 2009 +0100
@@ -196,7 +196,7 @@
                 # default to 1000 so view boxes occurs after component boxes
                 return x[-1].get('order', 1000)
             # x is a component box
-            return x.propval('order')
+            return x.cw_propval('order')
         return sorted(sideboxes, key=get_order)
 
     def _section_def(self, entity, where):
@@ -255,7 +255,7 @@
         # nb: rset retreived using entity.related with limit + 1 if any
         # because of that, we known that rset.printable_rql() will return
         # rql with no limit set anyway (since it's handled manually)
-        if 'dispctrl' in self.extra_kwargs:
+        if 'dispctrl' in self.cw_extra_kwargs:
             limit = self.extra_kwargs['dispctrl'].get('limit')
         else:
             limit = None