cwvreg.py
changeset 2770 356e9d7c356d
parent 2705 30bcdbd92820
child 2771 8074dd88e21b
equal deleted inserted replaced
2769:1800aa0bf396 2770:356e9d7c356d
    67                 raise
    67                 raise
    68             obj = self.select(__fallback_oid, req, **kwargs)
    68             obj = self.select(__fallback_oid, req, **kwargs)
    69         return obj.render(**kwargs)
    69         return obj.render(**kwargs)
    70 
    70 
    71     def select_vobject(self, oid, *args, **kwargs):
    71     def select_vobject(self, oid, *args, **kwargs):
    72         selected = self.select_object(oid, *args, **kwargs)
    72         selected = self.select_or_none(oid, *args, **kwargs)
    73         if selected and selected.propval('visible'):
    73         if selected and selected.propval('visible'):
    74             return selected
    74             return selected
    75         return None
    75         return None
    76 
    76 
    77     def possible_vobjects(self, *args, **kwargs):
    77     def possible_vobjects(self, *args, **kwargs):
   170         """
   170         """
   171         for vid, views in self.items():
   171         for vid, views in self.items():
   172             if vid[0] == '_':
   172             if vid[0] == '_':
   173                 continue
   173                 continue
   174             try:
   174             try:
   175                 view = self.select_best(views, req, rset=rset, **kwargs)
   175                 view = self._select_best(views, req, rset=rset, **kwargs)
   176                 if view.linkable():
   176                 if view.linkable():
   177                     yield view
   177                     yield view
   178             except NoSelectableObject:
   178             except NoSelectableObject:
   179                 continue
   179                 continue
   180             except Exception:
   180             except Exception:
   387 
   387 
   388     @deprecated('use vreg["actions"].possible_actions(*args, **kwargs)')
   388     @deprecated('use vreg["actions"].possible_actions(*args, **kwargs)')
   389     def possible_actions(self, req, rset=None, **kwargs):
   389     def possible_actions(self, req, rset=None, **kwargs):
   390         return self["actions"].possible_actions(req, rest=rset, **kwargs)
   390         return self["actions"].possible_actions(req, rest=rset, **kwargs)
   391 
   391 
   392     @deprecated("use vreg['boxes'].select_object(...)")
   392     @deprecated("use vreg['boxes'].select_or_none(...)")
   393     def select_box(self, oid, *args, **kwargs):
   393     def select_box(self, oid, *args, **kwargs):
   394         return self['boxes'].select_object(oid, *args, **kwargs)
   394         return self['boxes'].select_or_none(oid, *args, **kwargs)
   395 
   395 
   396     @deprecated("use vreg['components'].select_object(...)")
   396     @deprecated("use vreg['components'].select_or_none(...)")
   397     def select_component(self, cid, *args, **kwargs):
   397     def select_component(self, cid, *args, **kwargs):
   398         return self['components'].select_object(cid, *args, **kwargs)
   398         return self['components'].select_or_none(cid, *args, **kwargs)
   399 
   399 
   400     @deprecated("use vreg['actions'].select_object(...)")
   400     @deprecated("use vreg['actions'].select_or_none(...)")
   401     def select_action(self, oid, *args, **kwargs):
   401     def select_action(self, oid, *args, **kwargs):
   402         return self['actions'].select_object(oid, *args, **kwargs)
   402         return self['actions'].select_or_none(oid, *args, **kwargs)
   403 
   403 
   404     @deprecated("use vreg['views'].select(...)")
   404     @deprecated("use vreg['views'].select(...)")
   405     def select_view(self, __vid, req, rset=None, **kwargs):
   405     def select_view(self, __vid, req, rset=None, **kwargs):
   406         return self['views'].select(__vid, req, rset=rset, **kwargs)
   406         return self['views'].select(__vid, req, rset=rset, **kwargs)
   407 
   407