appobject.py
changeset 7894 ad0eeb0f7a8d
parent 7879 9aae456abab5
child 7990 a673d1d9a738
equal deleted inserted replaced
7889:6cebeb1f386a 7894:ad0eeb0f7a8d
   322 class AppObject(object):
   322 class AppObject(object):
   323     """This is the base class for CubicWeb application objects which are
   323     """This is the base class for CubicWeb application objects which are
   324     selected according to a context (usually at least a request and a result
   324     selected according to a context (usually at least a request and a result
   325     set).
   325     set).
   326 
   326 
   327     The following attributes should be set on concret appobject classes:
   327     The following attributes should be set on concrete appobject classes:
   328 
   328 
   329     :attr:`__registry__`
   329     :attr:`__registry__`
   330       name of the registry for this object (string like 'views',
   330       name of the registry for this object (string like 'views',
   331       'templates'...)
   331       'templates'...)
   332 
   332 
   413         It must return the object that will be actually registered (this may be
   413         It must return the object that will be actually registered (this may be
   414         the right hook to create an instance for example). By default the
   414         the right hook to create an instance for example). By default the
   415         appobject is returned without any transformation.
   415         appobject is returned without any transformation.
   416         """
   416         """
   417         try: # XXX < 3.6 bw compat
   417         try: # XXX < 3.6 bw compat
   418             pdefs = cls.property_defs
   418             pdefs = cls.property_defs # pylint: disable=E1101
   419         except AttributeError:
   419         except AttributeError:
   420             pdefs = getattr(cls, 'cw_property_defs', {})
   420             pdefs = getattr(cls, 'cw_property_defs', {})
   421         else:
   421         else:
   422             warn('[3.6] property_defs is deprecated, use cw_property_defs in %s'
   422             warn('[3.6] property_defs is deprecated, use cw_property_defs in %s'
   423                  % cls, DeprecationWarning)
   423                  % cls, DeprecationWarning)