cubicweb.appobject
Contents
cubicweb.appobject
#
The AppObject class#
The AppObject class is the base class for all dynamically loaded objects (application objects) accessible through the vregistry.
We can find a certain number of attributes and methods defined in this class and common to all the application objects.
- class cubicweb.appobject.AppObject(req, **extra)[source]#
Bases:
logilab.common.registry.RegistrableObject
This is the base class for CubicWeb application objects which are selected in a request context.
The following attributes should be set on concrete appobject classes:
At selection time, the following attributes are set on the instance:
_cw
current request
cw_extra_kwargs
other received arguments
And also the following, only if rset is found in arguments (in which case rset/row/col will be removed from cwextra_kwargs):
cw_rset
context result set or None
cw_row
if a result set is set and the context is about a particular cell in the result set, and not the result set as a whole, specify the row number we are interested in, else None
cw_col
if a result set is set and the context is about a particular cell in the result set, and not the result set as a whole, specify the col number we are interested in, else None
Note
do not inherit directly from this class but from a more specific class such as AnyEntity, EntityView, AnyRsetView, ActionâŚ
- critical(msg, *args, **kwargs)#
Log âmsg % argsâ with severity âCRITICALâ.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.critical(âHouston, we have a %sâ, âmajor disasterâ, exc_info=1)
- cw_propval(propid)[source]#
return cw property value associated to key
<cls.__registry__>.<cls.id>.<propid>
- debug(msg, *args, **kwargs)#
Log âmsg % argsâ with severity âDEBUGâ.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.debug(âHouston, we have a %sâ, âthorny problemâ, exc_info=1)
- error(msg, *args, **kwargs)#
Log âmsg % argsâ with severity âERRORâ.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.error(âHouston, we have a %sâ, âmajor problemâ, exc_info=1)
- exception(msg, *args, exc_info=True, **kwargs)#
Convenience method for logging an ERROR with exception information.
- info(msg, *args, **kwargs)#
Log âmsg % argsâ with severity âINFOâ.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.info(âHouston, we have a %sâ, âinteresting problemâ, exc_info=1)
- warning(msg, *args, **kwargs)#
Log âmsg % argsâ with severity âWARNINGâ.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.warning(âHouston, we have a %sâ, âbit of a problemâ, exc_info=1)