users and status working
This commit is contained in:
24
app/alchemy/sap.py
Normal file
24
app/alchemy/sap.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from sqlalchemy import String, Text, ForeignKey
|
||||
from sqlalchemy.orm import Mapped, mapped_column, declared_attr
|
||||
|
||||
from .base import Base, bidirectional_relationship
|
||||
from .status import StatusForeignKey
|
||||
from .user import Versioned
|
||||
|
||||
|
||||
class SapNamePool(StatusForeignKey, Versioned, Base):
|
||||
"""SAP Printer Name Pool"""
|
||||
|
||||
code: Mapped[str] = mapped_column(String(12), primary_key=True, sort_order=-1000)
|
||||
description: Mapped[str] = mapped_column(String(256))
|
||||
notes: Mapped[str | None] = mapped_column(Text)
|
||||
|
||||
|
||||
class SapNamePoolForeignKey:
|
||||
"""Foreign Key Mixin for :py:class:`SapNamePool`"""
|
||||
|
||||
sap_name_pool_id: Mapped[str] = mapped_column(ForeignKey("sap_name_pool.id"))
|
||||
|
||||
@declared_attr
|
||||
def sap_name_pool(cls) -> Mapped["SapNamePool"]:
|
||||
return bidirectional_relationship(cls, SapNamePool)
|
||||
Reference in New Issue
Block a user