10.6.7. Class cerebro.events.AfterEventCreationOfTask

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

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

The class for the task creation event. It grants access to the data of the new task after writing it into the database.

Methods

The class object is input into the following function: after_event of the module event.

def after_event(event): 
        if event.event_type() == event.EVENT_CREATION_OF_TASK:
                ...
definition()[source]
Returns:a new message of the "Definition" type.
Return type:cerebro.events.AfterEventCreationOfMessage

Alongside with creation of a new task, a new Definition message is being created also, that’s why the event handles the Definition creation as well.

if event.event_type() == event.EVENT_CREATION_OF_TASK:
        message = event.definition()
        ...