Skip to content

animals#

Animals Database Model

Animals #

Bases: IDMixin, CreatedUpdatedMixin, DeletedAtMixin, Base

Animals Database Model

Source code in zoo/models/animals.py
class Animals(IDMixin, CreatedUpdatedMixin, DeletedAtMixin, Base):
    """
    Animals Database Model
    """

    __tablename__ = "animals"

    name: Mapped[str]
    description: Mapped[str] = mapped_column(default=None, nullable=True)
    species: Mapped[str] = mapped_column(default=None, nullable=True)
    exhibit_id: Mapped[int] = mapped_column(
        ForeignKey("exhibits.id"), nullable=True, default=None
    )

    exhibit: Mapped["Exhibits"] = relationship(back_populates="animals")