Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
feat(apps/submissions): creat folder submissions and initial model
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcfarias committed Nov 14, 2023
1 parent 2198017 commit 69e0ce8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apps/submissions/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from django.db.models import CASCADE, ForeignKey, TextField

from apps.tasks.models import Task
from apps.users.models import User
from core.models import TimestampedModel


class Submission(TimestampedModel):
id: int

author = ForeignKey(User, related_name="submissions", on_delete=CASCADE)
task = ForeignKey(Task, related_name="submissions", on_delete=CASCADE)
code = TextField()

class Meta:
db_table = "submissions"

def __str__(self) -> str:
return f"{self.code} #{self.id}"

0 comments on commit 69e0ce8

Please sign in to comment.