paperap.models.ui_settings.model module

UI Settings model for Paperless-NgX.

This module provides the UISettings model class for interacting with the Paperless-NgX UI settings API endpoint. UI settings control the appearance and behavior of the Paperless-NgX web interface.

Typical usage example:

```python # Get the current user’s UI settings ui_settings = client.ui_settings.get()

# Access specific settings dark_mode = ui_settings.settings.get(“dark_mode”, False)

# Update settings ui_settings.settings[“dark_mode”] = True ui_settings.save() ```

class paperap.models.ui_settings.model.UISettings(**data)[source]

Bases: StandardModel

Represents UI settings in Paperless-NgX.

This model provides access to user-specific UI settings and permissions in Paperless-NgX. Unlike most other models, there is typically only one UI settings object per user, and it contains all customizable aspects of the user interface.

user

Dictionary containing user information such as username and ID.

settings

Dictionary containing all UI settings like theme preferences, display options, and other customizable UI elements.

permissions

List of permission strings indicating what actions the current user is allowed to perform in the Paperless-NgX system.

Examples

Get and modify UI settings: ```python # Get current UI settings ui_settings = client.ui_settings.get()

# Check if dark mode is enabled is_dark_mode = ui_settings.settings.get(“dark_mode”, False)

# Enable dark mode ui_settings.settings[“dark_mode”] = True ui_settings.save()

# Check user permissions if “view_document” in ui_settings.permissions:

print(“User can view documents”)

```

Parameters:

data (Any)

user: dict[str, Any]
settings: dict[str, Any]
permissions: list[str]
class Meta(model)[source]

Bases: Meta

Metadata for the UISettings model.

This class defines metadata for the UISettings model, including the associated queryset class.

queryset

The UISettingsQuerySet class used for querying UI settings.

Parameters:

model (type[_Self])

queryset

alias of UISettingsQuerySet

blacklist_filtering_params: ClassVar[set[str]] = {}
field_map: dict[str, str] = {}
filtering_disabled: ClassVar[set[str]] = {}
filtering_fields: ClassVar[set[str]] = {'_resource', 'id', 'permissions', 'settings', 'user'}
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