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, **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)