From 7922e710cf74a073b76f759f08f45a3eb18659e4 Mon Sep 17 00:00:00 2001 From: ahtlon Date: Sat, 27 Jun 2026 16:39:23 +0200 Subject: [PATCH] [Cards] add serial, enabled, name fields --- app/model/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/model/models.py b/app/model/models.py index 87e7e33..02191da 100644 --- a/app/model/models.py +++ b/app/model/models.py @@ -7,7 +7,7 @@ class Base(SQLModel): #### User class UserBase(Base): - name: str = Field(index=True) + name: str = Field(index=True, unique=True) email: str | None = None is_admin: bool = False @@ -85,9 +85,17 @@ class AccessAuthorizationUpdate(Base): class Card(Base, table=True): id: int | None = Field(default=None, primary_key=True) key: str + card_serial: str + enabled: bool = True + name: str = Field(unique=True, max_length=32) group_id: int | None = Field(default=None, foreign_key="groupdb.id") group: GroupDB | None = Relationship(back_populates="cards") +class CardCreate(Base): + name: str = Field(unique=True, max_length=32) + enabled: bool = True + group_id: int + class TimetableBase(Base): weekday: int = Field(le=6, ge=0) starttime: time