fix:edu 增加用户ID

This commit is contained in:
zty 2024-06-06 09:45:12 +08:00
parent e32ee16d05
commit 7c9c8af963
4 changed files with 41 additions and 1 deletions

View File

@ -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),
),
]

View File

@ -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')

View File

@ -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,

View File

@ -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='变更日期'),
),
]