|
|
@@ -30,18 +30,18 @@ with open(os.path.join(local_path, "scripts/test/sa_device_type.json") , 'r', en
|
|
|
with open(os.path.join(local_path, "scripts/test/sa_user_purview.json") , 'r', encoding='utf-8') as f:
|
|
|
sa_user_purview = json.load(f)
|
|
|
for row in sa_user_purview.get("rows"):
|
|
|
- sa_user_purview, is_created = UserPurview.objects.get_or_create(
|
|
|
+ user_purview, is_created = UserPurview.objects.get_or_create(
|
|
|
id=row.get("id"),
|
|
|
defaults=row
|
|
|
)
|
|
|
- print(sa_user_purview.id, is_created)
|
|
|
+ print(user_purview.id, is_created)
|
|
|
|
|
|
|
|
|
with open(os.path.join(local_path, "scripts/test/sa_pest_bank.json") , 'r', encoding='utf-8') as f:
|
|
|
sa_pest_bank = json.load(f)
|
|
|
for row in sa_pest_bank.get("rows"):
|
|
|
- sa_pest_bank, is_created = UserPurview.objects.get_or_create(
|
|
|
+ pest_bank, is_created = UserPurview.objects.get_or_create(
|
|
|
id=row.get("id"),
|
|
|
defaults=row
|
|
|
)
|
|
|
- print(sa_pest_bank.id, is_created)
|
|
|
+ print(pest_bank.id, is_created)
|