forked from ananastya1/Streaming-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemas.py
51 lines (34 loc) · 799 Bytes
/
schemas.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from pydantic import BaseModel
from tortoise.contrib.pydantic import PydanticModel
from typing import List
class FilmCreate(BaseModel):
title: str
director: str
year: int
description: str
length: int
rating: str
class FilmUpdate(FilmCreate):
id: int
class FilmInDB(FilmUpdate):
id: int
class Film(FilmInDB):
pass
class GetCategory(PydanticModel):
category_name: str
class FilmActor(PydanticModel):
first_name: str
last_name: str
class FilmImage(PydanticModel):
image_url: str
class GetCategoryFilms(PydanticModel):
id: int
title: str
director: str
year: int
description: str
length: int
rating: str
categories: List[GetCategory] = []
cast: List[FilmActor] = []
image: List[FilmImage] = []