Enough for today
This commit is contained in:
12
src/schemas/courseprogress.py
Normal file
12
src/schemas/courseprogress.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from pydantic import BaseModel
|
||||
from enums import CourseEnum
|
||||
|
||||
|
||||
class CourseProgress(BaseModel):
|
||||
course_progress_id: int
|
||||
progress_value: float
|
||||
course: CourseEnum
|
||||
owner: int
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
17
src/schemas/highscores.py
Normal file
17
src/schemas/highscores.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pydantic import BaseModel
|
||||
from src.enums import MinigameEnum
|
||||
|
||||
|
||||
class HighScore(BaseModel):
|
||||
high_score_id: int
|
||||
score_value: float
|
||||
minigame: MinigameEnum
|
||||
owner_id: "User"
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
# It's ugly, but I have no choice
|
||||
from users import User
|
||||
HighScore.update_forward_refs()
|
||||
18
src/schemas/users.py
Normal file
18
src/schemas/users.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class User(BaseModel):
|
||||
user_id: int
|
||||
username: str
|
||||
hashed_password: str
|
||||
|
||||
high_scores: list[int] = []
|
||||
course_progresses: list[int] = []
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class UserCreate(BaseModel):
|
||||
username: str
|
||||
password: str
|
||||
Reference in New Issue
Block a user