Janeway (an open source publishing platform written in Python and using the Django framework) uses an event system that allows apps and plugins to register to be called when an event is fired. An example of this would be when a new submission is made.

event_logic.Events.ON_ARTICLE_SUBMITTED

This event is called whenever a new article is submitted, any app or plugin can register to have a function called when this event is triggered by the following method:

from events import logic as event_logicevent_logic.Events.register_for_event(event_logic.Events.ON_ARTICLE_SUBMITTED, plugins.my_submission_plugin.events.a_function)

The above is obviously an example, but you get the picture. By default an Event passes a set of keyword arguments for your function to use and these are documented inside events.logic.Events

Janeway uses the Event framework to handle raising of emails and entering Logs during its workflow process.

All of the credit (and blame if you hate it) for the Events framework goes to Martin P Eve. More information on Janeway can be found on its website or github.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store