导入问题 print bug
This commit is contained in:
parent
f88c19343f
commit
005a453a64
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 3.0.11 on 2021-01-29 01:57
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('ability', '0018_queryrecord'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='queryrecord',
|
||||||
|
name='ip',
|
||||||
|
field=models.CharField(blank=True, max_length=200, null=True, verbose_name='IP地址'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -9,7 +9,7 @@ from django.contrib.postgres.fields import JSONField
|
||||||
class QueryRecord(BaseModel):
|
class QueryRecord(BaseModel):
|
||||||
user = models.ForeignKey(User, related_name='record_user', on_delete=models.CASCADE)
|
user = models.ForeignKey(User, related_name='record_user', on_delete=models.CASCADE)
|
||||||
path = models.CharField('访问地址', max_length=200)
|
path = models.CharField('访问地址', max_length=200)
|
||||||
ip = models.CharField('IP地址', max_length=200)
|
ip = models.CharField('IP地址', max_length=200, null=True, blank=True)
|
||||||
method = models.CharField('方法', max_length=100, default='GET')
|
method = models.CharField('方法', max_length=100, default='GET')
|
||||||
query = JSONField(null=True,blank=True)
|
query = JSONField(null=True,blank=True)
|
||||||
search = models.TextField('搜索字符', null=True, blank=True)
|
search = models.TextField('搜索字符', null=True, blank=True)
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,6 @@ class CNASViewSet(RecordMixin, ModelViewSet):
|
||||||
os.chdir(fulldir)
|
os.chdir(fulldir)
|
||||||
CNAS.objects.all().delete()
|
CNAS.objects.all().delete()
|
||||||
with zipfile.ZipFile(fullpath,'r') as zzz:
|
with zipfile.ZipFile(fullpath,'r') as zzz:
|
||||||
print(zzz)
|
|
||||||
zzz.extractall(fulldir)
|
zzz.extractall(fulldir)
|
||||||
for root, dirs, files in os.walk(fulldir):
|
for root, dirs, files in os.walk(fulldir):
|
||||||
for f in files:
|
for f in files:
|
||||||
|
|
@ -446,7 +445,6 @@ def import_cnas(filename, path):
|
||||||
data['sszx'] = sszx
|
data['sszx'] = sszx
|
||||||
datalist.append(CNAS(**data))
|
datalist.append(CNAS(**data))
|
||||||
i = i + 1
|
i = i + 1
|
||||||
print(i,data)
|
|
||||||
CNAS.objects.bulk_create(datalist)
|
CNAS.objects.bulk_create(datalist)
|
||||||
|
|
||||||
def import_cma2(filename, path):
|
def import_cma2(filename, path):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue