
- Fixed circular imports in schema files by moving imports to module level - Changed orm_mode=True to model_config with from_attributes=True - Updated validator decorators to field_validator in all schema files - Properly annotated fields in all schema files for Pydantic v2 compatibility
21 lines
374 B
Python
21 lines
374 B
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class ActivityBase(BaseModel):
|
|
action: str
|
|
entity_type: str
|
|
entity_id: Optional[int] = None
|
|
details: Optional[str] = None
|
|
timestamp: datetime
|
|
|
|
|
|
class Activity(ActivityBase):
|
|
id: int
|
|
user_id: int
|
|
|
|
model_config = {
|
|
"from_attributes": True
|
|
} |