10.6.8. Class cerebro.events.AfterEventMessage

class cerebro.events.AfterEventMessage(event_type, event_id)[source]

Bases: cerebro.events.Event, cerebro.aclasses.Message

The base class for the task creation/change event. It grants access to the data of a created/modified message after it is written into the database.


See also


Returns:a list of new attachments to the message.
Return type:list(cerebro.aclasses.AbstractAttachment,)
Returns:a list of resources being reported for.
Return type:list(tuple,) - [(resource_id, resource_name),] - a list of tuples consisting of two fields: a resource ID and a resource name.

Resources are available in the "Resource Report" type only. If the message type is not the “Resource Report”, “None” is being returned.

if event.type() == event.TYPE_RESOURCE_REPORT:
        print('resources()', event.resources())