paperap.models.custom_field.model module


METADATA:

File: custom_field.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.custom_field.model.CustomField(**data)[source]

Bases: StandardModel

Represents a custom field in Paperless-NgX.

Parameters:

data (Any)

name: str
data_type: CustomFieldTypes | None
classmethod validate_data_type(v)[source]

Validate the data_type field.

Parameters:

v (Any) – The value to validate.

Return type:

CustomFieldTypes | None

Returns:

The validated value.

Raises:

ValueError – If the value is not a valid data type.

extra_data: dict[str, Any]
document_count: int
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', '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].

class Meta(model)[source]

Bases: Meta

Parameters:

model (type[_Self])

read_only_fields: ClassVar[set[str]] = {'id', 'slug'}
blacklist_filtering_params: ClassVar[set[str]] = {}
field_map: dict[str, str] = {}
filtering_disabled: ClassVar[set[str]] = {}
filtering_fields: ClassVar[set[str]] = {'_resource', 'data_type', 'document_count', 'extra_data', 'id', 'name'}
supported_filtering_params: ClassVar[set[str]] = {'id', 'id__in', 'limit'}
model: type[_Self]
name: str
property documents: DocumentQuerySet

Get documents with this custom field.

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