diff --git a/src/pwncore/models/ctf.py b/src/pwncore/models/ctf.py index 611a1d7..d86a19d 100644 --- a/src/pwncore/models/ctf.py +++ b/src/pwncore/models/ctf.py @@ -39,7 +39,8 @@ class Problem(BaseProblem): ma = fields.IntField(default=500) visible = fields.BooleanField(default=True) tags = fields.SmallIntField(default=1) # by default misc, 16 tag limit - + difficulty_level = fields.SmallIntField(default=1) + problem_type = fields.TextField(default="jeopardy") #Can use enum too hints: fields.ReverseRelation[Hint] class PydanticMeta: diff --git a/src/pwncore/models/round2.py b/src/pwncore/models/round2.py new file mode 100644 index 0000000..9896676 --- /dev/null +++ b/src/pwncore/models/round2.py @@ -0,0 +1,19 @@ +from tortoise import fields +from tortoise.models import Model +from tortoise.contrib.pydantic import pydantic_model_creator + +from pwncore.models.ctf import Problem +from pwncore.models.user import Team + + +class AttackDefProblem(Model): + id = fields.IntField(pk=True) + team: fields.ForeignKeyRelation[Team] = fields.ForeignKeyField( + "models.Team", related_name="attackdef_problems" + ) + problem: fields.ForeignKeyRelation[Problem] = fields.ForeignKeyField( + "models.Problem", related_name="problems" + ) + + +AttackDefProblem_Pydantic = pydantic_model_creator(AttackDefProblem) \ No newline at end of file diff --git a/src/pwncore/types.py b/src/pwncore/types.py index 0db45c2..95ddbfd 100644 --- a/src/pwncore/types.py +++ b/src/pwncore/types.py @@ -1,2 +1,2 @@ """Only for type aliases and nothing else. -""" +""" \ No newline at end of file