Add flag field to Submission model with FlagChoices enum

Adds red/blue/green/yellow flag options for marking submissions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 17:23:05 +08:00
parent 9e8c3d7ebb
commit aa344b92e5
2 changed files with 33 additions and 0 deletions

View File

@@ -11,6 +11,13 @@ from task.models import Task
from prompt.models import Conversation
class FlagChoices(models.TextChoices):
RED = "red", "值得展示"
BLUE = "blue", "需要讲解"
GREEN = "green", "优秀作品"
YELLOW = "yellow", "需要改进"
class Submission(TimeStampedModel):
id = models.UUIDField(
primary_key=True,
@@ -31,6 +38,14 @@ class Submission(TimeStampedModel):
Conversation, on_delete=models.SET_NULL, null=True, blank=True,
related_name="submissions", verbose_name="对话"
)
flag = models.CharField(
max_length=10,
choices=FlagChoices.choices,
null=True,
blank=True,
default=None,
verbose_name="标记",
)
class Meta:
ordering = ("-created",)