diff --git a/rdfproxy/__init__.py b/rdfproxy/__init__.py index 6b95c77..984bb66 100644 --- a/rdfproxy/__init__.py +++ b/rdfproxy/__init__.py @@ -1,4 +1,4 @@ from rdfproxy.adapter import SPARQLModelAdapter # noqa: F401 from rdfproxy.mapper import ModelBindingsMapper # noqa: F401 -from rdfproxy.utils._types import SPARQLBinding # noqa: F401 +from rdfproxy.utils._types import ConfigDict, SPARQLBinding # noqa: F401 from rdfproxy.utils.models import Page, QueryParameters # noqa: F401 diff --git a/rdfproxy/utils/_types.py b/rdfproxy/utils/_types.py index 93b59d1..8969353 100644 --- a/rdfproxy/utils/_types.py +++ b/rdfproxy/utils/_types.py @@ -3,7 +3,7 @@ from collections.abc import Iterable from typing import Protocol, TypeAlias, TypeVar, runtime_checkable -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict as PydanticConfigDict _TModelInstance = TypeVar("_TModelInstance", bound=BaseModel) @@ -42,3 +42,10 @@ def __call__(self, model: BaseModel) -> bool: ... _TModelBoolValue: TypeAlias = ModelBoolPredicate | str | Iterable[str] + + +class ConfigDict(PydanticConfigDict, total=False): + """pydantic.ConfigDict extension for RDFProxy model_config options.""" + + group_by: str + model_bool: _TModelBoolValue