-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.py
41 lines (34 loc) · 868 Bytes
/
model.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
from datetime import date
from typing import Optional
from pydantic import BaseModel
class FootballMatch(BaseModel):
id: int
home_team: str
away_team: str
match_date: date
place: str
duration: int
home_score: int
away_score: int
yellow_cards: int
red_cards: int
class MatchCreate(BaseModel):
home_team: str
away_team: str
match_date: date
place: str
duration: int
home_score: int
away_score: int
yellow_cards: int
red_cards: int
class MatchUpdate(BaseModel):
home_team: Optional[str] = None
away_team: Optional[str] = None
match_date: Optional[date] = None
place: Optional[str] = None
duration: Optional[int] = None
home_score: Optional[int] = None
away_score: Optional[int] = None
yellow_cards: Optional[int] = None
red_cards: Optional[int] = None