GenoRobotics-EPFL / Database

https://database-database.vercel.app
0 stars 1 forks source link

example of sqlalchemy v2 #47

Closed Plouc314 closed 1 year ago

Plouc314 commented 1 year ago
class Location(Base):
    __tablename__ = "location"

    id: Mapped[int] = mapped_column(primary_key=True)
    street: Mapped[str]
    street_number: Mapped[str]
    region_zip: Mapped[str]
    city: Mapped[str]

    flats: Mapped[list["Flat"]] = relationship(back_populates="location")