From fd9ed8aaef92d8a875252df5d3574cebfcf43af3 Mon Sep 17 00:00:00 2001 From: xpr Date: Wed, 26 Jan 2022 20:42:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=BAActivity=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0category=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/models.py b/app/models.py index 409f533f1..fff05aceb 100644 --- a/app/models.py +++ b/app/models.py @@ -703,6 +703,15 @@ class Status(models.TextChoices): objects = ActivityManager() + class ActivityCategory(models.IntegerChoices): + NORMAL = (0, "普通活动") + COURSE = (1, "课程活动") + ELECTION = (2, "选课活动") + + category = models.SmallIntegerField( + "活动类别", choices=ActivityCategory.choices, default=0 + ) + def save(self, *args, **kwargs): self.YQPoint = round(self.YQPoint, 1) self.typename = "activity" From 9a52a79e2dd51bd46e92c381afdf772b3d1e6530 Mon Sep 17 00:00:00 2001 From: xpr Date: Wed, 26 Jan 2022 20:49:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=BAActivity=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0category=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index fff05aceb..13fbe25a4 100644 --- a/app/models.py +++ b/app/models.py @@ -706,7 +706,7 @@ class Status(models.TextChoices): class ActivityCategory(models.IntegerChoices): NORMAL = (0, "普通活动") COURSE = (1, "课程活动") - ELECTION = (2, "选课活动") + ELECTION = (2, "选课活动") # 不一定会使用到 category = models.SmallIntegerField( "活动类别", choices=ActivityCategory.choices, default=0