Initial commit.
This commit is contained in:
commit
189f73b7c2
34 changed files with 1064 additions and 0 deletions
19
models/room_functions.py
Normal file
19
models/room_functions.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
from typing import List, Optional, TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
from .rooms import Room
|
||||
|
||||
from sqlalchemy import Identity, Integer, Unicode
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from . import db
|
||||
|
||||
class RoomFunction(db.Model):
|
||||
__tablename__ = 'Room Functions'
|
||||
|
||||
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)
|
||||
|
||||
rooms: Mapped[List['Room']] = relationship('Room', back_populates='room_function')
|
||||
|
||||
def __repr__(self):
|
||||
return f"<RoomFunction(id={self.id}, description={repr(self.description)})>"
|
Loading…
Add table
Add a link
Reference in a new issue