Enough for today

This commit is contained in:
lvrossem
2023-03-27 23:19:59 +02:00
parent 765f3e9bef
commit fc63176642
9 changed files with 80 additions and 52 deletions

View 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
View 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
View 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