From 1a4ca7f8e2e4de9c27b63d51323a34d387b6926c Mon Sep 17 00:00:00 2001 From: Josef Petrak Date: Sat, 23 Sep 2023 21:51:02 +0200 Subject: [PATCH] Fix code style --- django_nuts/loaders/__init__.py | 4 ++-- django_nuts/loaders/cz_nuts4_lau.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django_nuts/loaders/__init__.py b/django_nuts/loaders/__init__.py index cce895a..87a8dbf 100644 --- a/django_nuts/loaders/__init__.py +++ b/django_nuts/loaders/__init__.py @@ -88,8 +88,8 @@ def load_lau(*country_codes): country_codes = (key for key in data.keys() if len(key) == 2) for country_code in country_codes: sheet = data[country_code] - nuts = {n.code: n for n in NUTS.objects.filter(code__startswith=country_code).iterator()} - laus = {l.code: l for l in LAU.objects.filter(code__startswith=country_code).iterator()} + nuts = {n_nuts.code: n_nuts for n_nuts in NUTS.objects.filter(code__startswith=country_code).iterator()} + laus = {l_lau.code: l_lau for l_lau in LAU.objects.filter(code__startswith=country_code).iterator()} created, updated = 0, 0 for row in sheet[1:]: # handle exceptions in data diff --git a/django_nuts/loaders/cz_nuts4_lau.py b/django_nuts/loaders/cz_nuts4_lau.py index da77509..1772d02 100644 --- a/django_nuts/loaders/cz_nuts4_lau.py +++ b/django_nuts/loaders/cz_nuts4_lau.py @@ -18,8 +18,8 @@ def load_cz_nuts4_lau(): # take last sheet sheet = data[list(data.keys())[-1]] - nuts = {n.code: n for n in NUTS.objects.filter(code__startswith='CZ').iterator()} - laus = {l.code: l for l in LAU.objects.filter(code__startswith='CZ').iterator()} + nuts = {n_nuts.code: n_nuts for n_nuts in NUTS.objects.filter(code__startswith='CZ').iterator()} + laus = {l_lau.code: l_lau for l_lau in LAU.objects.filter(code__startswith='CZ').iterator()} nuts_created, nuts_updated, lau_created, lau_updated = 0, 0, 0, 0 for row in sheet[2:]: lau_code, lau_name = row[0:2]