Descriptors Modules

Module for defining descriptors related to defining the fields that appear for a given config in settings.ACTION_TRIGGERS.

Note: This is not used in the current implementation. It is a work in progress and a placeholder for future work.

class action_triggers.descriptors.config_field.ConfigField(required: bool = True, **kwargs)[source]

Bases: object

Descriptor representing a particular config element that appears in the Action Triggers settings (settings.ACTION_TRIGGERS).

Parameters:
  • required – Whether or not the field defined is required. (default: True)

  • kwargs – Additional keyword arguments to be passed to the field

Module contains descriptors relating to the storing of error messages for later use.

class action_triggers.descriptors.error.ErrorField[source]

Bases: object

Descriptor for storing error messages for a field.

add_error(instance: object, key: str, message: str) None[source]

Adds an error for the field.

Parameters:
  • instance – The instance of the class.

  • key – The key for the error.

  • message – The error message.