first
This commit is contained in:
0
sop-back/app/schemas/__init__.py
Normal file
0
sop-back/app/schemas/__init__.py
Normal file
39
sop-back/app/schemas/schemas.py
Normal file
39
sop-back/app/schemas/schemas.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from datetime import datetime
|
||||
from typing import List
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
class CharacterOut(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
name: str
|
||||
filename: str
|
||||
s3_url: str
|
||||
collection_id: int
|
||||
|
||||
|
||||
class CollectionSummary(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
name: str
|
||||
created_at: datetime
|
||||
character_count: int = 0
|
||||
|
||||
|
||||
class CollectionOut(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
name: str
|
||||
created_at: datetime
|
||||
characters: List[CharacterOut] = []
|
||||
|
||||
|
||||
class CollectionCreate(BaseModel):
|
||||
name: str
|
||||
|
||||
|
||||
class AdminStatus(BaseModel):
|
||||
admin_enabled: bool
|
||||
Reference in New Issue
Block a user