formaptix-server/database/form.py

14 lines
362 B
Python
Raw Normal View History

2024-08-10 20:38:54 +03:00
from sqlalchemy import JSON
from sqlalchemy.orm import Mapped, mapped_column, relationship
from database import Base, User
class Form(Base):
__tablename__ = "forms"
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str]
owner: Mapped[User] = relationship(User, cascade="all, delete")
data: Mapped[dict] = mapped_column(JSON)