PaperParser/app/models/user_collection.py

13 lines
464 B
Python
Raw Normal View History

2024-02-24 22:34:54 +10:00
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")