Split frontend model from backend model
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 26s

This commit is contained in:
2024-02-25 15:09:59 +01:00
parent a9b1bc4403
commit 991a1a177e
38 changed files with 1094 additions and 930 deletions

View File

@ -0,0 +1,22 @@
from typing import List
from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column
from formula10 import db
class DbTeam(db.Model):
"""
A constructor/team (name only).
"""
__tablename__ = "team"
def __init__(self, *, name: str):
self.name = name # Primary key
@classmethod
def from_csv(cls, row: List[str]):
db_team: DbTeam = cls(name=str(row[0]))
return db_team
name: Mapped[str] = mapped_column(String(32), primary_key=True)