R propagate deprecation of CWRegistry.possible_vobjects
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 13 Aug 2009 10:55:58 +0200
changeset 2813 0cf6c8005bf6
parent 2805 c6d10de521bc
child 2814 112742b3bbe1
R propagate deprecation of CWRegistry.possible_vobjects
devtools/testlib.py
doc/book/en/development/webstdlib/basetemplates.rst
rset.py
web/test/unittest_views_actions.py
web/test/unittest_views_navigation.py
web/views/basetemplates.py
web/views/facets.py
web/views/primary.py
web/views/tableview.py
--- a/devtools/testlib.py	Thu Aug 13 10:49:14 2009 +0200
+++ b/devtools/testlib.py	Thu Aug 13 10:55:58 2009 +0200
@@ -391,18 +391,18 @@
     def pactions(self, req, rset,
                  skipcategories=('addrelated', 'siteactions', 'useractions')):
         return [(a.id, a.__class__)
-                for a in self.vreg['actions'].possible_vobjects(req, rset=rset)
+                for a in self.vreg['actions'].poss_visible_objects(req, rset=rset)
                 if a.category not in skipcategories]
 
     def pactions_by_cats(self, req, rset, categories=('addrelated',)):
         return [(a.id, a.__class__)
-                for a in self.vreg['actions'].possible_vobjects(req, rset=rset)
+                for a in self.vreg['actions'].poss_visible_objects(req, rset=rset)
                 if a.category in categories]
 
     def pactionsdict(self, req, rset,
                      skipcategories=('addrelated', 'siteactions', 'useractions')):
         res = {}
-        for a in self.vreg['actions'].possible_vobjects(req, rset=rset):
+        for a in self.vreg['actions'].poss_visible_objects(req, rset=rset):
             if a.category not in skipcategories:
                 res.setdefault(a.category, []).append(a.__class__)
         return res
--- a/doc/book/en/development/webstdlib/basetemplates.rst	Thu Aug 13 10:49:14 2009 +0200
+++ b/doc/book/en/development/webstdlib/basetemplates.rst	Thu Aug 13 10:55:58 2009 +0200
@@ -126,8 +126,8 @@
                       title=False, message=False)
 
     def get_searchbox(self, view, context):
-        boxes = list(self.vreg.possible_vobjects('boxes', self.req, self.rset,
-                                                 view=view, context=context))
+        boxes = list(self.vreg.poss_visible_objects('boxes', self.req, self.rset,
+                                                    view=view, context=context))
         if boxes:
             for box in boxes:
                 if box.id == 'search_box':
--- a/rset.py	Thu Aug 13 10:49:14 2009 +0200
+++ b/rset.py	Thu Aug 13 10:55:58 2009 +0200
@@ -83,7 +83,7 @@
         try:
             return self._rsetactions[key]
         except KeyError:
-            actions = self.vreg['actions'].possible_vobjects(
+            actions = self.vreg['actions'].poss_visible_objects(
                 self.req, rset=self, **kwargs)
             self._rsetactions[key] = actions
             return actions
--- a/web/test/unittest_views_actions.py	Thu Aug 13 10:49:14 2009 +0200
+++ b/web/test/unittest_views_actions.py	Thu Aug 13 10:55:58 2009 +0200
@@ -13,20 +13,20 @@
     def test_view_action(self):
         req = self.request(__message='bla bla bla', vid='rss', rql='CWUser X')
         rset = self.execute('CWUser X')
-        vaction = [action for action in self.vreg['actions'].possible_vobjects(req, rset=rset)
-                   if action.id == 'view'][0]
+        actions = self.vreg['actions'].poss_visible_objects(req, rset=rset)
+        vaction = [action for action in actions if action.id == 'view'][0]
         self.assertEquals(vaction.url(), 'http://testing.fr/cubicweb/view?rql=CWUser%20X')
 
     def test_sendmail_action(self):
         req = self.request()
         rset = self.execute('Any X WHERE X login "admin"', req=req)
-        self.failUnless([action for action in self.vreg['actions'].possible_vobjects(req, rset=rset)
-                         if action.id == 'sendemail'])
+        actions = self.vreg['actions'].poss_visible_objects(req, rset=rset)
+        self.failUnless([action for action in actions if action.id == 'sendemail'])
         self.login('anon')
         req = self.request()
         rset = self.execute('Any X WHERE X login "anon"', req=req)
-        self.failIf([action for action in self.vreg['actions'].possible_vobjects(req, rset=rset)
-                     if action.id == 'sendemail'])
+        actions = self.vreg['actions'].poss_visible_objects(req, rset=rset)
+        self.failIf([action for action in actions if action.id == 'sendemail'])
 
 if __name__ == '__main__':
     unittest_main()
--- a/web/test/unittest_views_navigation.py	Thu Aug 13 10:49:14 2009 +0200
+++ b/web/test/unittest_views_navigation.py	Thu Aug 13 10:55:58 2009 +0200
@@ -102,12 +102,12 @@
         view = mock_object(is_primary=lambda x: True)
         rset = self.execute('CWUser X LIMIT 1')
         req = self.request()
-        objs = self.vreg['contentnavigation'].possible_vobjects(
+        objs = self.vreg['contentnavigation'].poss_visible_objects(
             req, rset=rset, view=view, context='navtop')
         # breadcrumbs should be in headers by default
         clsids = set(obj.id for obj in objs)
         self.failUnless('breadcrumbs' in clsids)
-        objs = self.vreg['contentnavigation'].possible_vobjects(
+        objs = self.vreg['contentnavigation'].poss_visible_objects(
             req, rset=rset, view=view, context='navbottom')
         # breadcrumbs should _NOT_ be in footers by default
         clsids = set(obj.id for obj in objs)
@@ -116,12 +116,12 @@
                      'P value "navbottom"')
         # breadcrumbs should now be in footers
         req.cnx.commit()
-        objs = self.vreg['contentnavigation'].possible_vobjects(
+        objs = self.vreg['contentnavigation'].poss_visible_objects(
             req, rset=rset, view=view, context='navbottom')
 
         clsids = [obj.id for obj in objs]
         self.failUnless('breadcrumbs' in clsids)
-        objs = self.vreg['contentnavigation'].possible_vobjects(
+        objs = self.vreg['contentnavigation'].poss_visible_objects(
             req, rset=rset, view=view, context='navtop')
 
         clsids = [obj.id for obj in objs]
--- a/web/views/basetemplates.py	Thu Aug 13 10:49:14 2009 +0200
+++ b/web/views/basetemplates.py	Thu Aug 13 10:55:58 2009 +0200
@@ -172,7 +172,7 @@
         self.w(u'</body>')
 
     def nav_column(self, view, context):
-        boxes = list(self.vreg['boxes'].possible_vobjects(
+        boxes = list(self.vreg['boxes'].poss_visible_objects(
             self.req, rset=self.rset, view=view, context=context))
         if boxes:
             self.w(u'<td class="navcol"><div class="navboxes">\n')
@@ -241,7 +241,7 @@
         w(u'<table width="100%" height="100%" border="0"><tr>\n')
         w(u'<td class="navcol">\n')
         self.topleft_header()
-        boxes = list(self.vreg['boxes'].possible_vobjects(
+        boxes = list(self.vreg['boxes'].poss_visible_objects(
             self.req, rset=self.rset, view=view, context='left'))
         if boxes:
             w(u'<div class="navboxes">\n')
@@ -404,7 +404,7 @@
 
     def call(self, view, **kwargs):
         """by default, display informal messages in content header"""
-        components = self.vreg['contentnavigation'].possible_vobjects(
+        components = self.vreg['contentnavigation'].poss_visible_objects(
             self.req, rset=self.rset, view=view, context='navtop')
         if components:
             self.w(u'<div id="contentheader">')
@@ -420,7 +420,7 @@
     id = 'contentfooter'
 
     def call(self, view, **kwargs):
-        components = self.vreg['contentnavigation'].possible_vobjects(
+        components = self.vreg['contentnavigation'].poss_visible_objects(
             self.req, rset=self.rset, view=view, context='navbottom')
         if components:
             self.w(u'<div id="contentfooter">')
--- a/web/views/facets.py	Thu Aug 13 10:49:14 2009 +0200
+++ b/web/views/facets.py	Thu Aug 13 10:55:58 2009 +0200
@@ -118,9 +118,9 @@
             self.w(self.bk_linkbox_template % bk_link)
 
     def get_facets(self, rset, mainvar):
-        return self.vreg['facets'].possible_vobjects(self.req, rset=rset,
-                                                     context='facetbox',
-                                                     filtered_variable=mainvar)
+        return self.vreg['facets'].poss_visible_objects(self.req, rset=rset,
+                                                        context='facetbox',
+                                                        filtered_variable=mainvar)
 
 # facets ######################################################################
 
--- a/web/views/primary.py	Thu Aug 13 10:49:14 2009 +0200
+++ b/web/views/primary.py	Thu Aug 13 10:55:58 2009 +0200
@@ -71,7 +71,7 @@
 
     def content_navigation_components(self, context):
         self.w(u'<div class="%s">' % context)
-        for comp in self.vreg['contentnavigation'].possible_vobjects(
+        for comp in self.vreg['contentnavigation'].poss_visible_objects(
             self.req, rset=self.rset, row=self.row, view=self, context=context):
             try:
                 comp.render(w=self.w, row=self.row, view=self)
@@ -147,7 +147,7 @@
             label = display_name(self.req, rschema.type, role)
             vid = dispctrl.get('vid', 'sidebox')
             sideboxes.append( (label, rset, vid) )
-        sideboxes += self.vreg['boxes'].possible_vobjects(
+        sideboxes += self.vreg['boxes'].poss_visible_objects(
             self.req, rset=self.rset, row=self.row, view=self,
             context='incontext')
         return sideboxes
--- a/web/views/tableview.py	Thu Aug 13 10:49:14 2009 +0200
+++ b/web/views/tableview.py	Thu Aug 13 10:55:58 2009 +0200
@@ -34,7 +34,7 @@
             return ()
         rqlst.save_state()
         mainvar, baserql = prepare_facets_rqlst(rqlst, self.rset.args)
-        wdgs = [facet.get_widget() for facet in self.vreg['facets'].possible_vobjects(
+        wdgs = [facet.get_widget() for facet in self.vreg['facets'].poss_visible_objects(
             self.req, rset=self.rset, context='tablefilter',
             filtered_variable=mainvar)]
         wdgs = [wdg for wdg in wdgs if wdg is not None]