fix: 添加维度评分字段到 Comment 模型

This commit is contained in:
maoshen
2026-04-14 12:18:01 +00:00
parent 7d968bbfe8
commit b2d3dff75e
3 changed files with 58 additions and 5 deletions

View File

@@ -103,8 +103,15 @@ class Comment(models.Model):
content_type = models.CharField('内容类型', max_length=20, choices=CONTENT_TYPE_CHOICES)
object_id = models.IntegerField('内容 ID')
content = models.TextField('批注内容')
score = models.IntegerField('评分', null=True, blank=True, help_text='1-10 分')
content = models.TextField('批注内容', blank=True, default='')
score = models.IntegerField('综合评分', null=True, blank=True, help_text='1-10 分')
# 多维度评分
quality = models.IntegerField('完成质量', null=True, blank=True, help_text='1-10 分')
efficiency = models.IntegerField('效率', null=True, blank=True, help_text='1-10 分')
creativity = models.IntegerField('创新性', null=True, blank=True, help_text='1-10 分')
learning = models.IntegerField('学习价值', null=True, blank=True, help_text='1-10 分')
created_by = models.CharField('创建者', max_length=100, default='北极星')
created_at = models.DateTimeField('创建时间', auto_now_add=True)
@@ -114,8 +121,7 @@ class Comment(models.Model):
verbose_name_plural = '批注'
def __str__(self):
score_text = f' | {self.score}' if self.score else ''
return f"{self.content_type} #{self.object_id} - {self.created_by}{score_text}"
return f"{self.content_type} #{self.object_id} - {self.created_by}"
class Task(models.Model):