19 lines
425 B
Python
19 lines
425 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class BaseSchema(BaseModel):
|
|
"""Base schema with common configurations."""
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
|
class BaseSchemaID(BaseSchema):
|
|
"""Base schema with ID."""
|
|
id: int
|
|
|
|
|
|
class BaseSchemaIDTimestamps(BaseSchemaID):
|
|
"""Base schema with ID and timestamps."""
|
|
created_at: datetime
|
|
updated_at: datetime |