This commit is contained in:
shijing 2022-06-24 08:30:56 +08:00
commit fc17cd2995
4 changed files with 37 additions and 13 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 3.0.5 on 2022-06-07 06:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ability', '0035_auto_20220607_0900'),
]
operations = [
migrations.AlterField(
model_name='quali',
name='grade',
field=models.PositiveSmallIntegerField(blank=True, choices=[(10, '国家级'), (20, '省级'), (30, '市级'), (40, '实验室'), (50, '检验机构')], null=True, verbose_name='等级1'),
),
]

View File

@ -143,12 +143,14 @@ class Quali(CommonAModel):
QUALI_GRADE_CHOICES = (
(10, '国家级'),
(20, '省级'),
(30, '市级')
(30, '市级'),
(40, '实验室'),
(50, '检验机构')
)
org = models.ForeignKey(Organization, on_delete=models.CASCADE, verbose_name='所属单位')
name = models.CharField('资质名称', max_length=20, null=True, blank=True)
type = models.CharField('资质类型', choices=QUALI_TYPE_CHOICES, max_length=10)
grade = models.PositiveSmallIntegerField('等级1', null=True, blank=True)
grade = models.PositiveSmallIntegerField('等级1', null=True, blank=True, choices=QUALI_GRADE_CHOICES)
scope = models.TextField('范围', null=True, blank=True)
level = models.CharField('等级2', max_length=10, null=True, blank=True)
province = models.ForeignKey(Province, on_delete=models.SET_NULL, null=True, blank=True)

View File

@ -374,7 +374,7 @@ class UserViewSet(PageOrNot, ModelViewSet):
def daoru(self, request, pk=None):
from openpyxl import load_workbook
wb = load_workbook('./media/default/users.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')
sheet = wb.get_sheet_by_name('Sheet2')
i = 3
role1 = Role.objects.get(name='能力查询')
role2 = Role.objects.get(name='资质能力报送')

View File

@ -186,16 +186,20 @@ AUTHENTICATION_BACKENDS = (
# 缓存配置
# CACHES = {
# "default": {
# "BACKEND": "django_redis.cache.RedisCache",
# "LOCATION": "redis://127.0.0.1:6379/9",
# "OPTIONS": {
# "CLIENT_CLASS": "django_redis.client.DefaultClient",
# # "PICKLE_VERSION": -1
# }
# }
# }
CACHES = {
# "default": {
# "BACKEND": "django_redis.cache.RedisCache",
# "LOCATION": "redis://127.0.0.1:6379/9",
# "OPTIONS": {
# "CLIENT_CLASS": "django_redis.client.DefaultClient",
# # "PICKLE_VERSION": -1
# }
# }
'default': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': os.path.join(BASE_DIR, 'temp'),
}
}
# 日志配置
# 创建日志的路径
LOG_PATH = os.path.join(BASE_DIR, 'log')