Base classes

class ephios.core.signup.methods.BaseSignupMethod(shift, event=None)
_abc_impl = <_abc._abc_data object>
_configure_participation(participation: AbstractParticipation, **kwargs) AbstractParticipation

Configure the given participation object for signup according to the method’s configuration. You need at least to set the participations state, as that is not done with the participation form. kwargs contains the signup form’s cleaned_data.

property configuration_form_class
property disposition_participation_form_class

This form will be used for participations in disposition. Set to None if you don’t want to support the default disposition.

get_configuration_form(*args, **kwargs)

This form will be used to configure this signup method. The cleaned data will be saved to shift.signup_configuration


Return a tuple of min, max for how many participants are allowed for the shift. Use None for any value if it is not specifiable.


Returns a displayable representation of participation that can be rendered into a table (e.g. for pdf export). Must return a list of participations or empty slots. Each element of the list has to be a list of a fixed size where each entry is rendered to a separate column. Ex.: [[„participant1_name“, „participant1_qualification“], [„participant2_name“, „participant2_qualification“]]

get_shift_state_context_data(request, **kwargs)

Additionally to the context of the event detail view, provide context for rendering shift_state_template_name.


Return key/value pairs about the configuration to show in exports etc.

get_signup_stats() SignupStats

Return an instance of SignupStats for the shift.


Return a SignupActionValidator for this signup method.

perform_decline(participant, participation=None, **kwargs)

Create and configure a declining participation object for the given participant. kwargs may contain further instructions from a e.g. a form.

perform_signup(participant: AbstractParticipant, participation=None, acting_user=None, **kwargs) AbstractParticipation

Creates and/or configures a participation object for a given participant and sends out notifications. Passes the participation and kwargs to configure_participation to do configuration specific to the signup method.


Render the state/participations of the shift. Match the signature of template.render for use with the include template tag: {% include shift.signup_method %} By default, this loads shift_state_template_name and renders it using context from get_shift_state_context_data.

property shift_state_template_name
property signup_action_validator_class
property signup_view

This view will be used to sign up for shifts.

property signup_view_class
class ephios.core.consequences.BaseConsequenceHandler
classmethod execute(consequence)

Gets a consequence and tries to execute whatever it is the consequence wants to happen.

classmethod filter_queryset(qs, user: UserProfile)

Return a filtered that excludes consequences with the slug of this class that the user is not allowed to edit. Consequences should also be annotated with values needed for rendering.

classmethod render(consequence)

Return html describing the action to be done as a consequence of what. Return None if you cannot handle this consequence.

property slug
classmethod as_html(notification)
classmethod as_plaintext(notification)
email_template_name = 'core/mails/notification.html'
classmethod get_actions(notification)

Return a list of (label, url) tuples that make this notification actionable. The first url will be used as the primary action in push notifications.

classmethod get_actions_with_referrer(notification)

Annotate the actions returned by any subclass with a reference to the originating notification. This is used by EphiosNotificationMiddleware to mark the corresponding notification as read once the user clicks on the link.

classmethod get_body(notification)
classmethod get_render_context(notification)
classmethod get_subject(notification)
classmethod is_obsolete(notification)
plaintext_template_name = 'core/mails/notification.txt'
property slug
property title
unsubscribe_allowed = True
classmethod send(notification: Notification)
classmethod send_multiple(notifications: Iterable[Notification])
classmethod sending_possible(notification)
classmethod should_send(notification)
property slug
property title
classmethod user_prefers_sending(notification)