10.6.16. Class cerebro.events.BeforeEventChangingOfTasksHashtags¶
The class for the
tasks hashtagschanging event. It grants access to the task hashtags being changed before writing them into the database.
def before_event(event): if event.event_type() == event.EVENT_CHANGING_OF_TASKS_HASHTAGS: ...
Returns: True, if hashtags are being added to task(s). False, is being removed. Return type: bool
def before_event(event): if event.event_type() == event.EVENT_CHANGING_OF_TASKS_HASHTAGS: # hashtags is being changed if event.is_added() == False: # hashtags are being dismissed # asking the user if he/she is sure to do it q = 'Are you sure you want to remove hashtags from the task?' if cerebro.gui.question_box('User list change', q) == False: # if the user is not sure raise Exception('') # Hashtags will remain added to the task