修改model
This commit is contained in:
parent
95d5aca312
commit
27d5877d36
|
@ -32,11 +32,10 @@ export function logout() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getInfo(token) {
|
export function getInfo() {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/info/',
|
url: '/system/user/info/',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { token }
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
# Generated by Django 3.0.7 on 2020-12-30 08:26
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('ability', '0016_qualification_ssbm'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='cnas',
|
||||||
|
name='bzbh',
|
||||||
|
field=models.TextField(blank=True, null=True, verbose_name='标准编号'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='cnas',
|
||||||
|
name='bzmc',
|
||||||
|
field=models.TextField(blank=True, null=True, verbose_name='标准名称'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='cnas',
|
||||||
|
name='bztk',
|
||||||
|
field=models.TextField(blank=True, null=True, verbose_name='标准条款'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='cnas',
|
||||||
|
name='lbmc',
|
||||||
|
field=models.TextField(blank=True, null=True, verbose_name='类别名称'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='cnas',
|
||||||
|
name='xmmc',
|
||||||
|
field=models.TextField(blank=True, null=True, verbose_name='项目名称'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -1,9 +1,18 @@
|
||||||
|
from datetime import MAXYEAR
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.db.models.fields import related
|
||||||
from utils.model import BaseModel
|
from utils.model import BaseModel
|
||||||
from apps.system.models import Organization
|
from apps.system.models import Organization, User
|
||||||
|
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
|
|
||||||
|
# class GetRecord(BaseModel):
|
||||||
|
# user = models.ForeignKey(User, related_name='record_user', on_delete=models.CASCADE)
|
||||||
|
# path = models.CharField('访问地址', max_length=100)
|
||||||
|
# ip = models.CharField('IP地址', max_length=100)
|
||||||
|
# method = models.CharField('方法', max_length=100, default='GET')
|
||||||
|
|
||||||
|
|
||||||
class CMA(BaseModel):
|
class CMA(BaseModel):
|
||||||
"""
|
"""
|
||||||
CMA检测能力表
|
CMA检测能力表
|
||||||
|
@ -47,11 +56,11 @@ class CNAS(BaseModel):
|
||||||
"""
|
"""
|
||||||
CNAS检测能力表
|
CNAS检测能力表
|
||||||
"""
|
"""
|
||||||
lbmc = models.CharField('类别名称', max_length=200,null=True,blank=True)
|
lbmc = models.TextField('类别名称', null=True,blank=True)
|
||||||
xmmc = models.CharField('项目名称', max_length=200,null=True,blank=True)
|
xmmc = models.TextField('项目名称', null=True,blank=True)
|
||||||
bzmc = models.CharField('标准名称', max_length=400,null=True,blank=True)
|
bzmc = models.TextField('标准名称', null=True,blank=True)
|
||||||
bzbh = models.CharField('标准编号', max_length=400,null=True,blank=True)
|
bzbh = models.TextField('标准编号', null=True,blank=True)
|
||||||
bztk = models.CharField('标准条款', max_length=400,null=True,blank=True)
|
bztk = models.TextField('标准条款', null=True,blank=True)
|
||||||
sszx = models.TextField('所属中心',null=True,blank=True)
|
sszx = models.TextField('所属中心',null=True,blank=True)
|
||||||
|
|
||||||
class Qualification(BaseModel):
|
class Qualification(BaseModel):
|
||||||
|
|
|
@ -13,7 +13,22 @@ from openpyxl import Workbook, load_workbook
|
||||||
from django.db.models import Count
|
from django.db.models import Count
|
||||||
from utils.pagination import PageOrNot
|
from utils.pagination import PageOrNot
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
class CMAViewSet(ModelViewSet):
|
import json
|
||||||
|
|
||||||
|
class RecordMixin():
|
||||||
|
def perform_authentication(self, request):
|
||||||
|
"""
|
||||||
|
Perform authentication on the incoming request.
|
||||||
|
|
||||||
|
Note that if you override this and simply 'pass', then authentication
|
||||||
|
will instead be performed lazily, the first time either
|
||||||
|
`request.user` or `request.auth` is accessed.
|
||||||
|
"""
|
||||||
|
user = request.user
|
||||||
|
if request.method == 'GET':
|
||||||
|
print(json.dumps(request.query_params), request.method, request.path)
|
||||||
|
|
||||||
|
class CMAViewSet(RecordMixin, ModelViewSet):
|
||||||
"""
|
"""
|
||||||
CMA检测能力:增删改查
|
CMA检测能力:增删改查
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue