diff --git a/README.md b/README.md index 3106b3e..90e2e46 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ class Bar(BaseModel): banana: str = 'y' class Spam(BaseModel): + # PydanticObjectId is an alias to Annotated[ObjectId, ObjectIdAnnotation] id: Optional[PydanticObjectId] = None foo: Foo bars: List[Bar] diff --git a/pydantic_mongo/__init__.py b/pydantic_mongo/__init__.py index a098bb9..74e0bf9 100644 --- a/pydantic_mongo/__init__.py +++ b/pydantic_mongo/__init__.py @@ -1,5 +1,5 @@ from .abstract_repository import AbstractRepository -from .fields import ObjectIdField, PydanticObjectId +from .fields import ObjectIdAnnotation, ObjectIdField, PydanticObjectId from .version import __version__ # noqa: F401 -__all__ = ["ObjectIdField", "PydanticObjectId", "AbstractRepository"] +__all__ = ["AbstractRepository", "ObjectIdField", "ObjectIdAnnotation", "PydanticObjectId"]