11 lines
253 B
Python
11 lines
253 B
Python
from uuid import UUID, uuid4
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class BaseMongoModel(BaseModel):
|
|
id: UUID = Field(default_factory=uuid4, alias="_id")
|
|
|
|
class Config:
|
|
json_encoders = {UUID: str}
|
|
arbitrary_types_allowed = True
|