from pydantic import BaseModel from typing import List, Optional class TopicNoId(BaseModel): name: str description: Optional[str] class Config: orm_mode = True class Topic(TopicNoId): topic_id: int class ArtistNoId(BaseModel): description: str topics: Optional[List[int]] class Config: orm_mode = True class Artist(ArtistNoId): artist_id: int class Config: orm_mode = True class Presence(BaseModel): name: str domain: str link: Optional[str] artist_id: Optional[int] class Config: orm_mode = True class ArtnoID(BaseModel): hash: Optional[str] path: Optional[str] title: Optional[str] = None link: Optional[str] = None presences: Optional[List[Presence]] class Config: orm_mode = True class Art(ArtnoID): id: int class Config: orm_mode = True