AKSolverInterface.views module

class AKSolverInterface.views.SchedulingWizardMixin[source]

Bases: WizardViewMixin

Mixin for all views of the automatic scheduling workflow

Defines title and steps of the wizard and provides the URLs of the previous and next step (as wizard_prev_url and wizard_next_url) for navigation. The steps before the export step are checks, they can be skipped (see wizard_skip_checks_url). Has to be combined with EventSlugMixin.

get_wizard_step_url(step: int) → str | None[source]

Get the URL of the given (1-based) step of the wizard (all steps can be accessed directly)

Parameters:

step – step to get the URL for

Returns:

URL or None if there is no such step

class AKSolverInterface.views.AKJSONExportView(**kwargs)[source]

Bases: EventSlugMixin, AdminViewMixin, SchedulingWizardMixin, FormView

View: Export all AK slots of this event in JSON format ordered by tracks

Part of the automatic scheduling workflow (step: Export). The generated JSON can be copied or downloaded as file (client-side, without serializing it again).

model

alias of Event

form_class

alias of JSONExportControlForm

produce_exceptions(form)[source]

Identify AKs that cannot be placed (no overlap between availabilities and default slots both in general and matching category). This will then adjust the form accordingly. :param form: form to adjust

class AKSolverInterface.views.AKScheduleJSONImportView(**kwargs)[source]

Bases: EventSlugMixin, SchedulingWizardMixin, IntermediateAdminView

View: Import an AK schedule from a json file that can be pasted into this view.

Part of the automatic scheduling workflow (step: Import). After a successful import, the number of imported slots (overall and per category) is stored in the session and the wizard continues with the results step (SchedulingWizardResultsView).

form_class

alias of JSONScheduleImportForm

class AKSolverInterface.views.SchedulingWizardChecksView(**kwargs)[source]

Bases: EventSlugMixin, AdminViewMixin, SchedulingWizardMixin, TemplateView

Wizard view (automatic scheduling): Entry/Checks

Shows the results of basic checks whether the event is ready for automatic scheduling (e.g., are there rooms and default slots?)

get_checks()[source]

Perform basic checks

Returns:

list of check results, each a dict with the keys title, status (see STATUS_* constants), message, and optionally link_url & link_text to fix problems as well as entries (list of dicts with text and url, e.g., the affected objects; not named “items” since that would collide with dict.items() in templates)

Return type:

list[dict]

class AKSolverInterface.views.SchedulingWizardRequirementsView(**kwargs)[source]

Bases: EventSlugMixin, AdminViewMixin, SchedulingWizardMixin, TemplateView

Wizard view (automatic scheduling): Room requirements

Lists all AKs whose requirements are not fulfilled by any single room of the event (see AKScheduling.checks.aks_with_unfulfillable_requirements()). These AKs cannot be placed by the solver.

class AKSolverInterface.views.SchedulingWizardSlotsView(**kwargs)[source]

Bases: EventSlugMixin, AdminViewMixin, SchedulingWizardMixin, TemplateView

Wizard view (automatic scheduling): AK slots

Checks for each AK whether its availabilities overlap long enough (at least the duration of its longest slot) with a default slot (see AKScheduling.checks.aks_not_in_default_schedules()). Distinguishes between AKs that do not fit into any default slot and AKs that only fit into default slots not intended for their category.

class AKSolverInterface.views.SchedulingWizardPreferencesView(**kwargs)[source]

Bases: EventSlugMixin, AdminViewMixin, SchedulingWizardMixin, TemplateView

Wizard view (automatic scheduling): Preferences

Checks whether the preferences marking participants as required for AKs can be fulfilled:

class AKSolverInterface.views.SchedulingWizardLookupView(**kwargs)[source]

Bases: EventSlugMixin, AdminViewMixin, SchedulingWizardMixin, TemplateView

Wizard view (automatic scheduling): Investigate issues

Allows quick lookups of the objects behind the IDs used in the solver export/output (AKs, AK slots, rooms, timeslots and participants). All necessary information is serialized into the page (see AKSolverInterface.lookup), the lookup itself is done in the browser without any API calls.

class AKSolverInterface.views.SchedulingWizardResultsView(**kwargs)[source]

Bases: EventSlugMixin, AdminViewMixin, SchedulingWizardMixin, TemplateView

Wizard view (automatic scheduling): Results

Shows the number of slots scheduled by the last import (overall and per category, stored in the session by AKScheduleJSONImportView). If AKScheduling is installed, the scheduling statistics (line chart and numbers, see AKScheduling.stats) are shown and linked, otherwise a generic success page.

static session_key(event: Event) → str[source]

Key used to store the results of the last import for the given event in the session