init
This commit is contained in:
19
app/models/task.py
Normal file
19
app/models/task.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from sqlmodel import SQLModel, Field, Relationship
|
||||
|
||||
|
||||
class Task(SQLModel, table=True):
|
||||
__tablename__ = "tasks"
|
||||
|
||||
id: int | None = Field(default=None, primary_key=True)
|
||||
hackathon_id: int = Field(foreign_key="hackathons.id")
|
||||
title: str = Field(max_length=200)
|
||||
description: str
|
||||
requirements: str
|
||||
evaluation_criteria: str
|
||||
|
||||
# Relationships
|
||||
hackathon: "Hackathon" = Relationship(back_populates="tasks")
|
||||
submissions: list["Submission"] = Relationship(
|
||||
back_populates="task",
|
||||
sa_relationship_kwargs={"cascade": "all, delete"},
|
||||
)
|
||||
Reference in New Issue
Block a user