Skip to content

Commit

Permalink
PR #360 : 为Activity表增加category属性,供书院课程活动使用
Browse files Browse the repository at this point in the history
Merge pull request #360 from cqkmxpr/develop
  • Loading branch information
panhongtao07 authored Jan 30, 2022
2 parents d48f00a + 9a52a79 commit c5a2f43
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c5a2f43

Please sign in to comment.