calingen.settings
¶
App-specific settings with their default values.
Notes
These (app-specific) settings are injected into the project’s settings
module during startup, see this StackOverflow answer [1] for the general idea
and calingen.apps.CalingenConfig.ready()
for implementation details.
The actual settings are defined here with their respective default value. This module serves as the single source of truth about app-specific settings, meaning it defines the settings’ names, as they will be used in other components of the app.
During runtime, all settings are read from django.conf.settings
- which
is effectively the project’s settings
module.
calingen.apps.CalingenConfig.ready()
checks the presence of all
app-specific settings in the project’s settings
module and will inject the
default values as defined in this module, if the setting is missing.
If the setting is already present in the project’s settings
module, it will
not be modified.
References
Module Contents¶
- calingen.settings.CALINGEN_COMPILER¶
Configuration of the compiler plugins.
This setting determines the mapping of available instances of
CompilerProvider
and their association with source files, as determined bylayout_type
provided by implementations ofcalingen.interfaces.plugin_api.LayoutProvider
.Default value:
{ "default": "calingen.contrib.compilers.copy_paste.compiler.CopyPasteCompiler" }
Notes
More mappings may be added by specifying this setting in a project’s settings module.
The accepted keys are of type
str
and should match whatever the project’s layouts (that is: implementations ofLayoutProvider
) provide with their respectivelayout_type
attributes. If a givenlayout_type
is not found in this setting, thedefault
compiler is used.The expected values are of type
str
and should specify a dotted Python path to an implementation ofcalingen.interfaces.plugin_api.CompilerProvider
.This setting is evaluated in
calingen.views.generation.CompilerView
.calingen.checks.check_config_value_compiler()
verifies the presence of a"default"
compiler and that the specified default compiler is importable.
- calingen.settings.CALINGEN_MISSING_EVENT_PROVIDER_NOTIFICATION¶
Determines, if the user should be notified about missing event providers.
Default value:
None
Accepted values:
None
."messages"
Notes
The user may activate implementations of
EventProvider
in hisProfile
. These events will then get included while generating his calendar inlays.However, the administrator may choose to disable certain plugins _after_ the user has activated them. The corresponding
EventProvider
will then not be available.When the user visits his
Profile
, he can only select thoseEventProvider
, which are currently activated by the administrator. Formerly activated plugins are hidden - but still stored in the profile instance.This setting controls, if the user is notified about the deactivation of a formerly selected
EventProvider
using Django’smessages
framework.See
calingen.views.profile.ProfileUpdateView.get_context_data()
for implementation details.See
calingen.checks.check_config_value_event_provider_notification()
for the corresponding contribution to Django’s check framework.