vscode ready

This commit is contained in:
2024-09-28 14:40:40 +02:00
parent 4856f5823f
commit a7f4b797e8
3 changed files with 11 additions and 9 deletions

View File

@@ -21,9 +21,9 @@ def get_related_logs_of_type(asset, type):
response = farm_client.resource.get('log', type)
ret = []
for log in response['data']:
assets = log['relationships']['asset']['data']
for asset in assets:
if asset['id'] == id:
log_assets = log['relationships']['asset']['data']
for log_asset in log_assets:
if log_asset['id'] == asset['id']:
ret.append(log)
return ret
@@ -49,7 +49,7 @@ for item in response['data']:
for asset in assets:
if asset['type'] == 'asset--plant':
plant_id = asset['id']
seedings = get_related_logs_of_type(plant_id, 'seeding')
seedings = get_related_logs_of_type(asset, 'seeding')
for seeding in seedings:
area_quants = get_related_quantities_of_measure(seeding, 'area')
for area_quant in area_quants: