导入问题 print bug

This commit is contained in:
caoqianming 2021-01-29 10:02:04 +08:00
parent f88c19343f
commit 005a453a64
3 changed files with 19 additions and 3 deletions

View File

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

View File

@ -9,7 +9,7 @@ from django.contrib.postgres.fields import JSONField
class QueryRecord(BaseModel):
user = models.ForeignKey(User, related_name='record_user', on_delete=models.CASCADE)
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')
query = JSONField(null=True,blank=True)
search = models.TextField('搜索字符', null=True, blank=True)

View File

@ -356,7 +356,6 @@ class CNASViewSet(RecordMixin, ModelViewSet):
os.chdir(fulldir)
CNAS.objects.all().delete()
with zipfile.ZipFile(fullpath,'r') as zzz:
print(zzz)
zzz.extractall(fulldir)
for root, dirs, files in os.walk(fulldir):
for f in files:
@ -446,7 +445,6 @@ def import_cnas(filename, path):
data['sszx'] = sszx
datalist.append(CNAS(**data))
i = i + 1
print(i,data)
CNAS.objects.bulk_create(datalist)
def import_cma2(filename, path):