Refactor models to implement ValidatableMixin; add validation logic for state management in Area, Brand, Item, Room, and RoomFunction classes
This commit is contained in:
parent
8de21bae9c
commit
d7e38cb8da
9 changed files with 196 additions and 9 deletions
|
@ -7,9 +7,11 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|||
|
||||
from . import db
|
||||
from ..temp import is_temp_id
|
||||
from ..utils.validation import ValidatableMixin
|
||||
|
||||
class RoomFunction(db.Model):
|
||||
class RoomFunction(ValidatableMixin, db.Model):
|
||||
__tablename__ = 'Room Functions'
|
||||
VALIDATION_LABEL = "Function"
|
||||
|
||||
id: Mapped[int] = mapped_column("ID", Integer, Identity(start=1, increment=1), primary_key=True)
|
||||
description: Mapped[Optional[str]] = mapped_column("Function", Unicode(255), nullable=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue