From 963e4c33099272e4ca51af8efee7b6093b7e22ff Mon Sep 17 00:00:00 2001 From: Deophius Date: Thu, 29 Feb 2024 03:11:07 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=20to=5Ffield=20?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E5=90=88=E5=B9=B6=E4=BA=86=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...record_source_type_permissionblacklist.py} | 21 +++++++++++-- .../0003_alter_yqpointrecord_source_type.py | 30 ------------------- generic/models.py | 1 - 3 files changed, 19 insertions(+), 33 deletions(-) rename generic/migrations/{0002_permissionblacklist.py => 0002_alter_yqpointrecord_source_type_permissionblacklist.py} (68%) delete mode 100644 generic/migrations/0003_alter_yqpointrecord_source_type.py diff --git a/generic/migrations/0002_permissionblacklist.py b/generic/migrations/0002_alter_yqpointrecord_source_type_permissionblacklist.py similarity index 68% rename from generic/migrations/0002_permissionblacklist.py rename to generic/migrations/0002_alter_yqpointrecord_source_type_permissionblacklist.py index 4c2d310fe..2f04f5ca9 100644 --- a/generic/migrations/0002_permissionblacklist.py +++ b/generic/migrations/0002_alter_yqpointrecord_source_type_permissionblacklist.py @@ -1,4 +1,4 @@ -# Generated by Django 5.0.1 on 2024-01-18 16:49 +# Generated by Django 5.0.1 on 2024-02-29 11:08 import django.db.models.deletion from django.conf import settings @@ -12,6 +12,24 @@ class Migration(migrations.Migration): ] operations = [ + migrations.AlterField( + model_name="yqpointrecord", + name="source_type", + field=models.SmallIntegerField( + choices=[ + (0, "系统操作"), + (1, "每日签到"), + (2, "参与活动"), + (3, "问题反馈"), + (4, "达成成就"), + (5, "填写问卷"), + (6, "奖池花费"), + (7, "奖池补偿"), + ], + default=0, + verbose_name="来源类型", + ), + ), migrations.CreateModel( name="PermissionBlacklist", fields=[ @@ -37,7 +55,6 @@ class Migration(migrations.Migration): models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, - to_field="username", verbose_name="用户", ), ), diff --git a/generic/migrations/0003_alter_yqpointrecord_source_type.py b/generic/migrations/0003_alter_yqpointrecord_source_type.py deleted file mode 100644 index 0c36de503..000000000 --- a/generic/migrations/0003_alter_yqpointrecord_source_type.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 5.0.1 on 2024-01-30 10:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("generic", "0002_permissionblacklist"), - ] - - operations = [ - migrations.AlterField( - model_name="yqpointrecord", - name="source_type", - field=models.SmallIntegerField( - choices=[ - (0, "系统操作"), - (1, "每日签到"), - (2, "参与活动"), - (3, "问题反馈"), - (4, "达成成就"), - (5, "填写问卷"), - (6, "奖池花费"), - (7, "奖池补偿"), - ], - default=0, - verbose_name="来源类型", - ), - ), - ] diff --git a/generic/models.py b/generic/models.py index a5ac63d93..4fd435218 100644 --- a/generic/models.py +++ b/generic/models.py @@ -444,7 +444,6 @@ class Meta: user = models.ForeignKey( User, verbose_name='用户', on_delete=models.CASCADE, - to_field='username', ) permission = models.ForeignKey( Permission, verbose_name='权限', on_delete=models.CASCADE,