22 lines
805 B
Python
22 lines
805 B
Python
from typing import List
|
|
from typing import Optional
|
|
from sqlalchemy import String
|
|
from sqlalchemy import ForeignKey
|
|
from sqlalchemy.orm import Mapped
|
|
from sqlalchemy.orm import mapped_column
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from .base import Base
|
|
|
|
class Env(Base):
|
|
__tablename__ = "env"
|
|
id: Mapped[int] = mapped_column(primary_key=True)
|
|
key: Mapped[str] = mapped_column(String(255))
|
|
value: Mapped[str] = mapped_column(String(65656))
|
|
|
|
library_id: Mapped[int] = mapped_column(ForeignKey("library.id"))
|
|
library: Mapped[int] = relationship("Library", back_populates="envs")
|
|
|
|
def __repr__(self) -> str:
|
|
return f"Book(id={self.id!r}, name={self.name!r}, publisher={self.publisher!r}," \
|
|
" notes={self.notes!r}, classification={self.classification!r})" |