from typing import List from sqlalchemy.orm import Mapped, mapped_column, relationship from app.extensions import db from app.models.task import Task from app.models.user import User class UsersCollection(db.Model): id: Mapped[int] = mapped_column(primary_key=True) Mapped[List[Task]] = relationship("Task", back_populates="collection") users: Mapped[List[User]] = relationship("User", cascade="all, delete-orphan", back_populates="collection")