You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
1.4 KiB
Python

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):
name: 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 TagnoID(BaseModel):
name: Optional[str]
description: Optional[str]
category_id: Optional[TagCategory]
class Config:
orm_mode = True
class Tag(TagnoID):
tag_ID: 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]]
tags: Optional[List[Tag]]
class Config:
orm_mode = True
class Art(ArtnoID):
id: int
class Config:
orm_mode = True