This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from src.db.models.comic import Artist
|
||||
|
||||
|
||||
class ArtistCreation(BaseModel):
|
||||
id: str
|
||||
@@ -7,7 +12,23 @@ class ArtistCreation(BaseModel):
|
||||
|
||||
class ArtistResponse(BaseModel):
|
||||
id: str
|
||||
created_date: datetime
|
||||
last_modified_date: datetime
|
||||
version: int
|
||||
name: str
|
||||
weblink: Optional[str]
|
||||
|
||||
def artist_to_response(artist: Artist) -> ArtistResponse:
|
||||
response: ArtistResponse = ArtistResponse(
|
||||
id=artist.id,
|
||||
created_date=artist.created_date,
|
||||
last_modified_date=artist.last_modified_date,
|
||||
version=artist.version,
|
||||
name=artist.name,
|
||||
weblink=artist.weblink
|
||||
)
|
||||
return response
|
||||
|
||||
|
||||
class AddArtist(BaseModel):
|
||||
id: str
|
||||
|
||||
Reference in New Issue
Block a user