cwvreg.py
changeset 2613 5e19c2bb370e
parent 2476 1294a6bdf3bf
child 2650 18aec79ec3a3
child 2651 3ad936634d2a
equal deleted inserted replaced
2612:c3059d308dc2 2613:5e19c2bb370e
     7 """
     7 """
     8 __docformat__ = "restructuredtext en"
     8 __docformat__ = "restructuredtext en"
     9 _ = unicode
     9 _ = unicode
    10 
    10 
    11 from logilab.common.decorators import cached, clear_cache
    11 from logilab.common.decorators import cached, clear_cache
    12 from logilab.common.deprecation import  obsolete
    12 from logilab.common.deprecation import  deprecated
    13 
    13 
    14 from rql import RQLHelper
    14 from rql import RQLHelper
    15 
    15 
    16 from cubicweb import ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid
    16 from cubicweb import ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid
    17 from cubicweb.vregistry import VRegistry, ObjectNotFound, NoSelectableObject
    17 from cubicweb.vregistry import VRegistry, ObjectNotFound, NoSelectableObject
   282                 continue
   282                 continue
   283             except Exception:
   283             except Exception:
   284                 self.exception('error while trying to select %s view for %s',
   284                 self.exception('error while trying to select %s view for %s',
   285                                vid, rset)
   285                                vid, rset)
   286 
   286 
   287     @obsolete("use .select_object('boxes', ...)")
   287     @deprecated("use .select_object('boxes', ...)")
   288     def select_box(self, oid, *args, **kwargs):
   288     def select_box(self, oid, *args, **kwargs):
   289         """return the most specific view according to the result set"""
   289         """return the most specific view according to the result set"""
   290         return self.select_object('boxes', oid, *args, **kwargs)
   290         return self.select_object('boxes', oid, *args, **kwargs)
   291 
   291 
   292     @obsolete("use .select_object('components', ...)")
   292     @deprecated("use .select_object('components', ...)")
   293     def select_component(self, cid, *args, **kwargs):
   293     def select_component(self, cid, *args, **kwargs):
   294         """return the most specific component according to the result set"""
   294         """return the most specific component according to the result set"""
   295         return self.select_object('components', cid, *args, **kwargs)
   295         return self.select_object('components', cid, *args, **kwargs)
   296 
   296 
   297     @obsolete("use .select_object('actions', ...)")
   297     @deprecated("use .select_object('actions', ...)")
   298     def select_action(self, oid, *args, **kwargs):
   298     def select_action(self, oid, *args, **kwargs):
   299         """return the most specific view according to the result set"""
   299         """return the most specific view according to the result set"""
   300         return self.select_object('actions', oid, *args, **kwargs)
   300         return self.select_object('actions', oid, *args, **kwargs)
   301 
   301 
   302     @obsolete("use .select('views', ...)")
   302     @deprecated("use .select('views', ...)")
   303     def select_view(self, __vid, req, rset=None, **kwargs):
   303     def select_view(self, __vid, req, rset=None, **kwargs):
   304         """return the most specific view according to the result set"""
   304         """return the most specific view according to the result set"""
   305         return self.select('views', __vid, req, rset=rset, **kwargs)
   305         return self.select('views', __vid, req, rset=rset, **kwargs)
   306 
   306 
   307     # properties handling #####################################################
   307     # properties handling #####################################################