Update maxheight field to be a string

This commit is contained in:
Dana Lambert 2021-12-07 14:54:59 +13:00 committed by Alistair McIntyre
parent ab48059387
commit 29417ca4e8
4 changed files with 25 additions and 4 deletions

View file

@ -17,7 +17,7 @@ ECO_REGION_ADJUSTMENTS = {
# Relevant columns and information used to retrieve information from the spreadsheet
PLANT_COLS = {
'SCIENTIFIC NAME': {"str": "name", "expected_type": str, "max_length": 50},
'MAX HT': {"str": "maxheight", "expected_type": float},
'MAX HT': {"str": "maxheight", "expected_type": str},
'SPACING': {"str": "spacing", "expected_type": float},
'COMMON NAME': {"str": "commonname", "expected_type": str, "null_allowed": True, "max_length": 200},
'SYNONYM': {"str": "synonym", "expected_type": str, "null_allowed": True, "max_length": 200},

View file

@ -56,6 +56,9 @@ def get_plant_json_from_row(row_data):
row_data[field_index], SOIL_ORDER_PK_MAPPING)
plant_json_fields[model_field_name] = soil_orders_list
elif field_str == "maxheight":
plant_json_fields[model_field_name] = str(row_data[field_index])
elif field_str in {'wet', 'mesic', 'dry'}:
if row_data[field_index] != None:
soil_variant_pk = SOIL_VARIANT_PK_MAPPING[field.capitalize()]