org.directives

Attributes

FormFactory

Classes

SettingViewMeta

SettingViewMetaAction

A configuration action.

SettingViewAction

A composite configuration action.

HomepageWidgetAction

Register a cronjob.

ExportAction

Register an export.

UserlinkAction

Registers a user link group.

DirectorySearchWidgetAction

Registers a directory search widget.

EventSearchWidgetAction

Registers a text search widget.

Boardlet

Registers a boardlet on the Dashboard.

Module Contents

type org.directives.FormFactory = type[Form] | Callable[[Any, RequestT], type[Form]][source]
class org.directives.SettingViewMeta[source]
model: type[source]
name: str[source]
form: FormFactory[Any][source]
setting: str[source]
icon: str[source]
order: int[source]
category: str | None[source]
class org.directives.SettingViewMetaAction(model: type, name: str, form: FormFactory[Any], setting: str | None, icon: str | None, order: int, category: str | None)[source]

Bases: dectate.Action

A configuration action.

Base class of configuration actions.

A configuration action is performed for an object (typically a function or a class object) and affects one or more configuration objects.

Actions can conflict with each other based on their identifier and discriminators. Actions can override each other based on their identifier. Actions can only be in conflict with actions of the same action class or actions with the same action_group.

config[source]

Describe configuration.

A dict mapping configuration names to factory functions. The resulting configuration objects are passed into Action.identifier(), Action.discriminators(), Action.perform(), and Action.before() and Action.after().

After commit completes, the configured objects are found as attributes on App.config.

model[source]
name[source]
form[source]
setting[source]
icon[source]
order[source]
category[source]
identifier(setting_view_registry: SettingViewRegistry) → tuple[type, str][source]
perform(obj: collections.abc.Callable[..., Any], setting_view_registry: SettingViewRegistry) → None[source]
class org.directives.SettingViewAction(model: type, name: str, form: FormFactory[RequestT], setting: str | None = None, icon: str | None = None, order: int = 0, category: str | None = None, listed: bool = True, render: collections.abc.Callable[[Any, RequestT], webob.Response] | None = None, template: str | None = None, load: collections.abc.Callable[[RequestT], Any] | None = None, permission: object | None = None, internal: bool = False, pass_model: bool = False, **predicates: Any)[source]

Bases: dectate.Composite

A composite configuration action.

Base class of composite actions.

Composite actions are very simple: implement the action method and return a iterable of actions in there.

query_classes[source]

A list of actual action classes that this composite can generate.

This is to allow the querying of composites. If the list if empty (the default) the query system refuses to query the composite. Note that if actions of the same action class can also be generated in another way they are in the same query result.

model[source]
name[source]
form[source]
setting = None[source]
icon = None[source]
order = 0[source]
category = None[source]
listed = True[source]
render = None[source]
template = None[source]
load = None[source]
permission = None[source]
internal = False[source]
pass_model = False[source]
predicates[source]
actions[RequestT: onegov.org.request.OrgRequest](obj: collections.abc.Callable[[Any, RequestT, Any], Any]) → collections.abc.Iterator[tuple[dectate.Action, collections.abc.Callable[[Any, RequestT, Any], Any]]][source]

Specify a iterable of actions to perform for obj.

The iteratable should yield action, obj tuples, where action is an instance of class Action or Composite and obj is the object to perform the action with.

Needs to be implemented by the Composite subclass.

Parameters:

obj – the obj that the composite action was performed on.

Returns:

iterable of action, obj tuples.

class org.directives.HomepageWidgetAction(tag: str)[source]

Bases: dectate.Action

Register a cronjob.

config[source]

Describe configuration.

A dict mapping configuration names to factory functions. The resulting configuration objects are passed into Action.identifier(), Action.discriminators(), Action.perform(), and Action.before() and Action.after().

After commit completes, the configured objects are found as attributes on App.config.

tag[source]
identifier(homepage_widget_registry: dict[str, RegisteredHomepageWidget]) → str[source]
perform(func: collections.abc.Callable[[], HomepageWidget], homepage_widget_registry: dict[str, RegisteredHomepageWidget]) → None[source]
class org.directives.ExportAction(id: str, **kwargs: Any)[source]

Bases: dectate.Action

Register an export.

config[source]

Describe configuration.

A dict mapping configuration names to factory functions. The resulting configuration objects are passed into Action.identifier(), Action.discriminators(), Action.perform(), and Action.before() and Action.after().

After commit completes, the configured objects are found as attributes on App.config.

id[source]
kwargs[source]
identifier(export_registry: dict[str, Any]) → str[source]
perform(cls: collections.abc.Callable[..., Any], export_registry: dict[str, Any]) → None[source]
class org.directives.UserlinkAction[source]

Bases: dectate.Action

Registers a user link group.

config[source]

Describe configuration.

A dict mapping configuration names to factory functions. The resulting configuration objects are passed into Action.identifier(), Action.discriminators(), Action.perform(), and Action.before() and Action.after().

After commit completes, the configured objects are found as attributes on App.config.

counter: ClassVar[source]
name[source]
identifier(linkgroup_registry: list[LinkGroupFactory]) → int[source]
perform(func: LinkGroupFactory, linkgroup_registry: list[LinkGroupFactory]) → None[source]
class org.directives.DirectorySearchWidgetAction(name: str)[source]

Bases: dectate.Action

Registers a directory search widget.

config[source]

Describe configuration.

A dict mapping configuration names to factory functions. The resulting configuration objects are passed into Action.identifier(), Action.discriminators(), Action.perform(), and Action.before() and Action.after().

After commit completes, the configured objects are found as attributes on App.config.

name[source]
identifier(directory_search_widget_registry: DirectorySearchWidgetRegistry) → str[source]
perform(cls: type[DirectorySearchWidget[Any]], directory_search_widget_registry: DirectorySearchWidgetRegistry) → None[source]
class org.directives.EventSearchWidgetAction(name: str)[source]

Bases: dectate.Action

Registers a text search widget.

config[source]

Describe configuration.

A dict mapping configuration names to factory functions. The resulting configuration objects are passed into Action.identifier(), Action.discriminators(), Action.perform(), and Action.before() and Action.after().

After commit completes, the configured objects are found as attributes on App.config.

name[source]
identifier(event_search_widget_registry: EventSearchWidgetRegistry) → str[source]
perform(cls: type[EventSearchWidget], event_search_widget_registry: EventSearchWidgetRegistry) → None[source]
class org.directives.Boardlet(name: str, order: tuple[int, int], icon: str = '', kind: Literal['user', 'citizen'] = 'user')[source]

Bases: dectate.Action

Registers a boardlet on the Dashboard.

config[source]

Describe configuration.

A dict mapping configuration names to factory functions. The resulting configuration objects are passed into Action.identifier(), Action.discriminators(), Action.perform(), and Action.before() and Action.after().

After commit completes, the configured objects are found as attributes on App.config.

name[source]
boardlet_order[source]
icon = ''[source]
kind = 'user'[source]
identifier(boardlets_registry: dict[BoardletKind, dict[str, BoardletConfig]]) → str[source]
perform(func: type[onegov.org.models.Boardlet], boardlets_registry: dict[BoardletKind, dict[str, BoardletConfig]]) → None[source]