考试增加是否公开字段
This commit is contained in:
parent
ff32c4e763
commit
4895d0a334
|
|
@ -16,5 +16,6 @@ class ExamFilter(filters.FilterSet):
|
||||||
fields = {
|
fields = {
|
||||||
'close_time': ['exact', 'gte', 'lte'],
|
'close_time': ['exact', 'gte', 'lte'],
|
||||||
'paper': ['exact'],
|
'paper': ['exact'],
|
||||||
'code': ['exact']
|
'code': ['exact'],
|
||||||
|
'is_open': ['exact']
|
||||||
}
|
}
|
||||||
|
|
@ -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='是否公开'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -87,6 +87,7 @@ class Exam(CommonAModel):
|
||||||
proctor_phone = models.CharField('监考人联系方式', max_length=100, null=True, blank=True)
|
proctor_phone = models.CharField('监考人联系方式', max_length=100, null=True, blank=True)
|
||||||
chance = models.IntegerField('考试机会', default=3)
|
chance = models.IntegerField('考试机会', default=3)
|
||||||
paper = models.ForeignKey(Paper, verbose_name='使用的试卷', on_delete=models.CASCADE, null=True, blank=True)
|
paper = models.ForeignKey(Paper, verbose_name='使用的试卷', on_delete=models.CASCADE, null=True, blank=True)
|
||||||
|
is_open = models.BooleanField('是否公开', default=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue