On Janeway Events

Andy Byers
1 min readOct 5, 2017

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.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Andy Byers
Andy Byers

Written by Andy Byers

Pub Tech developer for Birkbeck CTP

No responses yet

Write a response