Oopsie.
This commit is contained in:
parent
a76d19706c
commit
cc13321bbc
3 changed files with 36 additions and 0 deletions
16
inventory/models/device_type.py
Normal file
16
inventory/models/device_type.py
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
from typing import List, Optional
|
||||||
|
|
||||||
|
from sqlalchemy import Unicode
|
||||||
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||||
|
|
||||||
|
from crudkit.core.base import Base, CRUDMixin
|
||||||
|
|
||||||
|
class DeviceType(Base, CRUDMixin):
|
||||||
|
__tablename__ = 'item'
|
||||||
|
|
||||||
|
description: Mapped[Optional[str]] = mapped_column(Unicode(255), nullable=True)
|
||||||
|
|
||||||
|
inventory: Mapped[List['Inventory']] = relationship('Inventory', back_populates='device_type')
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"<Item(id={self.id}, description={repr(self.description)})>"
|
||||||
4
inventory/models/room.py
Normal file
4
inventory/models/room.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
from crudkit.core.base import Base, CRUDMixin
|
||||||
|
|
||||||
|
class Room(Base, CRUDMixin):
|
||||||
|
__tablename__ = 'rooms'
|
||||||
16
inventory/models/room_function.py
Normal file
16
inventory/models/room_function.py
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
from typing import List, Optional
|
||||||
|
|
||||||
|
from sqlalchemy import Unicode
|
||||||
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||||
|
|
||||||
|
from crudkit.core.base import Base, CRUDMixin
|
||||||
|
|
||||||
|
class RoomFunction(Base, CRUDMixin):
|
||||||
|
__tablename__ = "room_function"
|
||||||
|
|
||||||
|
description: Mapped[Optional[str]] = mapped_column(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