calingen.forms.generation
¶
Implementations of django.forms.Form
in the context of rendering and compilation.
Module Contents¶
Classes¶
Layout-specific configuration form. |
|
Select one of the available |
- class calingen.forms.generation.LayoutConfigurationForm(*args, request=None, **kwargs)¶
Bases:
calingen.forms.generic.RequestEnabledForm
Layout-specific configuration form.
Implementations of
calingen.interfaces.plugin_api.LayoutProvider
may provide a subclass of this form to fetch layout-specific configuration values during the rendering process of a layout.Warning
To make this work, the Django project must provide support for Django’s Sessions. This is in fact verified by
calingen.checks.check_session_enabled()
.Notes
For an example usage, see
calingen.contrib.layouts.lineatur.lineatur.LineaturForm
.- save_configuration()¶
Save the layout-specific configuration in the user’s
Session
.
- class calingen.forms.generation.LayoutSelectionForm(*args, request=None, **kwargs)¶
Bases:
calingen.forms.generic.RequestEnabledForm
Select one of the available
LayoutProvider
instances.Warning
To make this work, the Django project must provide support for Django’s Sessions. This is in fact verified by
calingen.checks.check_session_enabled()
.Notes
As all layouts require a
target_year
, this is included here aswell.- layout¶
Presentation of the available
LayoutProvider
.Notes
The available
LayoutProvider
are determined dynamically by callingLayoutProvider.list_available_plugins()
and presented using aRadioSelect
widget.
- target_year¶
Specify the year to create the layout for.
- save_selection()¶
Save the layout selection in the user’s
Session
.