From 9c1b6403985a8d29d70d91c3dc6702ef5ff48909 Mon Sep 17 00:00:00 2001 From: pu685px73 <2871633087@qq.com> Date: Mon, 10 Nov 2025 01:10:52 +0800 Subject: [PATCH] ADD file via upload --- .../0002_alter_comment_is_enable.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/comments/migrations/0002_alter_comment_is_enable.py diff --git a/src/comments/migrations/0002_alter_comment_is_enable.py b/src/comments/migrations/0002_alter_comment_is_enable.py new file mode 100644 index 0000000..57b2a1d --- /dev/null +++ b/src/comments/migrations/0002_alter_comment_is_enable.py @@ -0,0 +1,21 @@ +from django.db import migrations, models + + +class Migration(migrations.Migration): + + # 当前迁移文件依赖于 comments 应用的 0001 初始迁移文件 + dependencies = [ + ('comments', '0001_initial'), + ] + + operations = [ + # 修改 Comment 模型中 is_enable 字段的属性 + migrations.AlterField( + model_name='comment', # 要修改的模型名称 + name='is_enable', # 要修改的字段名 + field=models.BooleanField( + default=False, # 将默认值改为 False(即默认评论不显示) + verbose_name='是否显示' # 后台显示名称 + ), + ), + ]