| 1 |
from pydantic import ConfigDict, Field |
| 2 |
|
| 3 |
from beanie.odm.fields import IndexModelField |
| 4 |
from beanie.odm.settings.base import ItemSettings |
| 5 |
from beanie.odm.settings.timeseries import TimeSeriesConfig |
| 6 |
from beanie.odm.utils.update_merge import ActionConflictResolution |
| 7 |
|
| 8 |
|
| 9 |
class DocumentSettings(ItemSettings): |
| 10 |
use_state_management: bool = False |
| 11 |
state_management_replace_objects: bool = False |
| 12 |
state_management_save_previous: bool = False |
| 13 |
validate_on_save: bool = False |
| 14 |
use_revision: bool = False |
| 15 |
single_root_inheritance: bool = False |
| 16 |
|
| 17 |
indexes: list[IndexModelField] = Field(default_factory=list) |
| 18 |
merge_indexes: bool = False |
| 19 |
timeseries: TimeSeriesConfig | None = None |
| 20 |
|
| 21 |
lazy_parsing: bool = False |
| 22 |
|
| 23 |
keep_nulls: bool = True |
| 24 |
|
| 25 |
action_conflict_resolution: ActionConflictResolution = ( |
| 26 |
ActionConflictResolution.UPDATE_WINS |
| 27 |
) |
| 28 |
|
| 29 |
max_nesting_depths_per_field: dict = Field(default_factory=dict) |
| 30 |
max_nesting_depth: int = 3 |
| 31 |
|
| 32 |
model_config = ConfigDict( |
| 33 |
arbitrary_types_allowed=True, |
| 34 |
) |