Change index of custom_labels to string

This commit is contained in:
Fuhrmann 2025-02-21 12:53:42 +01:00
parent 19ed988760
commit 2211eb92de

View file

@ -341,17 +341,19 @@ class FeatureRenderer:
fields,
) as search_cursor:
for row in search_cursor:
id = str(row[0])
if id not in custom_labels:
if len(fields) == 3:
custom_labels[row[0]] = f"{row[1]}{label_delimieter}{row[2]}"
custom_labels[id] = f"{row[1]}{label_delimieter}{row[2]}"
elif len(fields) == 2:
if label_field_1 == primary_key_field:
custom_labels[row[0]] = (
custom_labels[id] = (
f"{row[0]}{label_delimieter}{row[1]}"
)
else:
custom_labels[row[0]] = f"{row[1]}"
custom_labels[id] = f"{row[1]}"
elif len(fields) == 1:
custom_labels[row[0]] = f"{row[0]}"
custom_labels[id] = f"{row[0]}"
# Retrieve headings
headings = {}