fix:edu 增加用户ID
This commit is contained in:
parent
e32ee16d05
commit
7c9c8af963
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.12 on 2024-06-06 01:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('edu', '0007_alter_certificate_examrecord'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='certificate',
|
||||
name='用户ID',
|
||||
field=models.IntegerField(blank=True, max_length=32, null=True),
|
||||
),
|
||||
]
|
|
@ -29,4 +29,5 @@ class Certificate(CommonADModel):
|
|||
培训结束日期 = models.DateField(null=True, blank=True)
|
||||
发证日期 = models.DateField(null=True, blank=True)
|
||||
证书地址 = models.CharField(max_length=100, null=True, blank=True)
|
||||
用户ID = models.IntegerField(null=True, blank=True, max_length=32)
|
||||
examrecord = models.OneToOneField('exam.ExamRecord', on_delete=models.CASCADE, null=True, blank=True, related_name='cert_er')
|
||||
|
|
|
@ -637,9 +637,10 @@ class ExamRecordViewSet(ListModelMixin, DestroyModelMixin, RetrieveModelMixin, G
|
|||
now_data = datetime.now()
|
||||
course = exam.course_name.all()
|
||||
courese_ids = [i.id for i in course]
|
||||
current_date = now_data.strftime('%Y-%m-%d')
|
||||
current_date = now_data.strftime('%Y%m%d')
|
||||
data_dict = {
|
||||
'姓名': request.user.name,
|
||||
'用户ID': request.user,
|
||||
'证书编号': 'CTCZL'+ current_date,
|
||||
'证书方案': '202312',
|
||||
'单位名称': request.user.dept.name,
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# Generated by Django 3.2.12 on 2024-06-06 01:44
|
||||
|
||||
import datetime
|
||||
from django.db import migrations, models
|
||||
from django.utils.timezone import utc
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('information', '0048_alter_qualification_change_date'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qualification',
|
||||
name='change_date',
|
||||
field=models.DateField(blank=True, default=datetime.datetime(2024, 6, 6, 1, 44, 19, 206626, tzinfo=utc), null=True, verbose_name='变更日期'),
|
||||
),
|
||||
]
|
Loading…
Reference in New Issue