paperap.models.workflow.model module


METADATA:

File: workflow.py

Project: paperap

Created: 2025-03-04

Version: 0.0.9

Author: Jess Mann Email: jess@jmann.me

Copyright (c) 2025 Jess Mann


LAST MODIFIED:

2025-03-04 By Jess Mann

class paperap.models.workflow.model.WorkflowTrigger(**data)[source]

Bases: StandardModel, MatcherMixin

Represents a workflow trigger in Paperless-NgX.

Parameters:

data (Any)

sources: list[WorkflowTriggerSourceType]
type: WorkflowTriggerType | None
filter_path: str | None
filter_filename: str | None
filter_mailrule: str | None
filter_has_tags: list[int]
filter_has_correspondent: int | None
filter_has_document_type: int | None
schedule_date_field: ScheduleDateFieldType | None
schedule_date_custom_field: int | None
schedule_offset_days: int
schedule_is_recurring: bool
schedule_recurring_interval_days: int
class Meta(model)[source]

Bases: Meta

Parameters:

model (type[_Self])

queryset

alias of WorkflowTriggerQuerySet

blacklist_filtering_params: ClassVar[set[str]] = {}
field_map: dict[str, str] = {}
filtering_disabled: ClassVar[set[str]] = {}
filtering_fields: ClassVar[set[str]] = {'_resource', 'filter_filename', 'filter_has_correspondent', 'filter_has_document_type', 'filter_has_tags', 'filter_mailrule', 'filter_path', 'id', 'schedule_date_custom_field', 'schedule_date_field', 'schedule_is_recurring', 'schedule_offset_days', 'schedule_recurring_interval_days', 'sources', 'type'}
read_only_fields: ClassVar[set[str]] = {'id'}
supported_filtering_params: ClassVar[set[str]] = {'id', 'id__in', 'limit'}
model: type[_Self]
name: str
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'populate_by_name': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

Parameters:
Return type:

None

id: int
class paperap.models.workflow.model.WorkflowAction(**data)[source]

Bases: StandardModel

Represents a workflow action in Paperless-NgX.

Parameters:

data (Any)

type: WorkflowActionType | None
assign_title: str | None
assign_tags: list[int]
assign_correspondent: int | None
assign_document_type: int | None
assign_storage_path: int | None
assign_owner: int | None
assign_view_users: list[int]
assign_view_groups: list[int]
assign_change_users: list[int]
assign_change_groups: list[int]
assign_custom_fields: list[int]
assign_custom_fields_values: dict[str, Any]
remove_all_tags: bool | None
remove_tags: list[int]
remove_all_correspondents: bool | None
remove_correspondents: list[int]
remove_all_document_types: bool | None
remove_document_types: list[int]
remove_all_storage_paths: bool | None
remove_storage_paths: list[int]
remove_custom_fields: list[int]
remove_all_custom_fields: bool | None
remove_all_owners: bool | None
remove_owners: list[int]
remove_all_permissions: bool | None
remove_view_users: list[int]
remove_view_groups: list[int]
remove_change_users: list[int]
remove_change_groups: list[int]
email: dict[str, Any] | None
webhook: dict[str, Any] | None
class Meta(model)[source]

Bases: Meta

Parameters:

model (type[_Self])

queryset

alias of WorkflowActionQuerySet

blacklist_filtering_params: ClassVar[set[str]] = {}
field_map: dict[str, str] = {}
filtering_disabled: ClassVar[set[str]] = {}
filtering_fields: ClassVar[set[str]] = {'_resource', 'assign_change_groups', 'assign_change_users', 'assign_correspondent', 'assign_custom_fields', 'assign_custom_fields_values', 'assign_document_type', 'assign_owner', 'assign_storage_path', 'assign_tags', 'assign_title', 'assign_view_groups', 'assign_view_users', 'email', 'id', 'remove_all_correspondents', 'remove_all_custom_fields', 'remove_all_document_types', 'remove_all_owners', 'remove_all_permissions', 'remove_all_storage_paths', 'remove_all_tags', 'remove_change_groups', 'remove_change_users', 'remove_correspondents', 'remove_custom_fields', 'remove_document_types', 'remove_owners', 'remove_storage_paths', 'remove_tags', 'remove_view_groups', 'remove_view_users', 'type', 'webhook'}
read_only_fields: ClassVar[set[str]] = {'id'}
supported_filtering_params: ClassVar[set[str]] = {'id', 'id__in', 'limit'}
model: type[_Self]
name: str
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'populate_by_name': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

Parameters:
Return type:

None

id: int
class paperap.models.workflow.model.Workflow(**data)[source]

Bases: StandardModel

Represents a workflow in Paperless-NgX.

Parameters:

data (Any)

name: str
order: int | None
enabled: bool | None
triggers: list[dict[str, Any]]
actions: list[dict[str, Any]]
class Meta(model)[source]

Bases: Meta

Metadata for the Workflow model.

Parameters:

model (type[_Self])

queryset

alias of WorkflowQuerySet

blacklist_filtering_params: ClassVar[set[str]] = {}
field_map: dict[str, str] = {}
filtering_disabled: ClassVar[set[str]] = {}
filtering_fields: ClassVar[set[str]] = {'_resource', 'actions', 'enabled', 'id', 'name', 'order', 'triggers'}
read_only_fields: ClassVar[set[str]] = {'id'}
supported_filtering_params: ClassVar[set[str]] = {'id', 'id__in', 'limit'}
model: type[_Self]
name: str
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'populate_by_name': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

Parameters:
Return type:

None

id: int
class paperap.models.workflow.model.WorkflowRun(**data)[source]

Bases: StandardModel

Represents a workflow run in Paperless-NgX.

Parameters:

data (Any)

workflow: int | None
document: int | None
type: WorkflowTriggerType | None
run_at: datetime
started: datetime | None
finished: datetime | None
status: str | None
error: str | None
class Meta(model)

Bases: Meta

Parameters:

model (type[_Self])

blacklist_filtering_params: ClassVar[set[str]] = {}
field_map: dict[str, str] = {}
filtering_disabled: ClassVar[set[str]] = {}
filtering_fields: ClassVar[set[str]] = {'_resource', 'document', 'error', 'finished', 'id', 'run_at', 'started', 'status', 'type', 'workflow'}
read_only_fields: ClassVar[set[str]] = {'id'}
supported_filtering_params: ClassVar[set[str]] = {'id', 'id__in', 'limit'}
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'populate_by_name': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

Parameters:
Return type:

None