考试增加是否公开字段

This commit is contained in:
caoqianming 2022-11-22 10:15:07 +08:00
parent ff32c4e763
commit 4895d0a334
3 changed files with 21 additions and 1 deletions

View File

@ -16,5 +16,6 @@ class ExamFilter(filters.FilterSet):
fields = {
'close_time': ['exact', 'gte', 'lte'],
'paper': ['exact'],
'code': ['exact']
'code': ['exact'],
'is_open': ['exact']
}

View File

@ -0,0 +1,18 @@
# Generated by Django 3.0.5 on 2022-11-22 02:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exam', '0004_auto_20221114_1108'),
]
operations = [
migrations.AddField(
model_name='exam',
name='is_open',
field=models.BooleanField(default=True, verbose_name='是否公开'),
),
]

View File

@ -87,6 +87,7 @@ class Exam(CommonAModel):
proctor_phone = models.CharField('监考人联系方式', max_length=100, null=True, blank=True)
chance = models.IntegerField('考试机会', default=3)
paper = models.ForeignKey(Paper, verbose_name='使用的试卷', on_delete=models.CASCADE, null=True, blank=True)
is_open = models.BooleanField('是否公开', default=True)
def __str__(self):
return self.name