14 lines
312 B
Python
14 lines
312 B
Python
|
|
from pydantic import BaseModel
|
||
|
|
from typing import Optional
|
||
|
|
from datetime import datetime
|
||
|
|
|
||
|
|
class User(BaseModel):
|
||
|
|
id: int
|
||
|
|
username: str
|
||
|
|
email: str
|
||
|
|
full_name: Optional[str] = None
|
||
|
|
is_active: bool = True
|
||
|
|
created_at: datetime = datetime.now()
|
||
|
|
|
||
|
|
class Config:
|
||
|
|
from_attributes = True
|