添加评论机器人与教师端脚本发布。

This commit is contained in:
2024-06-08 15:32:57 +08:00
parent 1c9972c389
commit c98a5ffeba
7 changed files with 98 additions and 24 deletions
+10
View File
@@ -119,6 +119,15 @@ class Task(AbstractModel):
def __str__(self):
return self.title
class Jiaoben(models.Model):
"""
存放脚本信息
"""
jiaoben = models.CharField(verbose_name='脚本信息', max_length=10240, null=False, blank=False)
class Meta:
db_table = 'jiaoben_tb'
verbose_name = '脚本'
verbose_name_plural = verbose_name
class Comment(models.Model): # 定义评论模型
@@ -129,6 +138,7 @@ class Comment(models.Model): # 定义评论模型
comment_time = models.DateTimeField(auto_now_add=True, verbose_name='评论时间')
pre_comment = models.ForeignKey('self', on_delete=models.DO_NOTHING, null=True,
verbose_name='父评论id') # 父级评论,如果没有父级则为空NULL, "self"表示外键关联自己
gpt_content = models.TextField(verbose_name='GPT返回结果',null=True, blank=True)
# comment_type = models.CharField(verbose_name='评论类型', max_length=1024, null=False, blank=False)
# comment_type = models.TextField(verbose_name='评论类型', default=json.dumps({"type": []}))
class Meta: