Skip to content

Commit

Permalink
🩹 Update renamed fields in update_georegion
Browse files Browse the repository at this point in the history
  • Loading branch information
pajowu committed Nov 7, 2023
1 parent 1e3ccaa commit 1331429
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fragdenstaat_de/theme/management/commands/update_georegion.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ def load_feature(self, feature, mapping, kind, level):
tree_params = get_new_child_params(None)
break

dlm_id = (
feature["DEBKG_ID"].as_string()
if "DEBKG_ID" in feature
else feature["DLM_ID"].as_string()
)

data = {
"slug": slug,
"name": name,
Expand All @@ -259,7 +265,7 @@ def load_feature(self, feature, mapping, kind, level):
"data": {
"label": full_name,
"nuts": nuts,
"DEBKG_ID": feature["DEBKG_ID"].as_string(),
"DEBKG_ID": dlm_id,
**extra_data,
},
}
Expand All @@ -278,7 +284,7 @@ def set_gov_seats(self, path, filename):
count = float(len(layer))
for i, feature in enumerate(layer):
self.stdout.write("%.2f%%\r" % (i / count * 100), ending="")
region_identifier = feature["RS"].as_string()
region_identifier = feature["ARS"].as_string()
try:
gr = GeoRegion.objects.get(region_identifier=region_identifier)
gr.gov_seat = mapping.feature_kwargs(feature)["geom"]
Expand Down

0 comments on commit 1331429

Please sign in to comment.