Skip to content

odmantic.config

Bases: ConfigDict

Source code in odmantic/config.py
12
13
14
15
16
17
18
19
class ODMConfigDict(ConfigDict, total=False):
    collection: str | None
    """Customize the collection name associated to the model"""
    parse_doc_with_default_factories: bool
    """Wether to allow populating field values with default factories while parsing
    documents from the database"""
    indexes: Callable[[], Iterable[ODMIndex.Index | pymongo.IndexModel]] | None
    """Define additional indexes for the model"""

collection: str | None instance-attribute

Customize the collection name associated to the model

indexes: Callable[[], Iterable[ODMIndex.Index | pymongo.IndexModel]] | None instance-attribute

Define additional indexes for the model

parse_doc_with_default_factories: bool instance-attribute

Wether to allow populating field values with default factories while parsing documents from the database