Cleaner, nicer code, and the harvest list query also happens to run much faster after these changes. Some things that used to be done by the web server and are now done by the Postgres server:
Computing VPD,
Joining the zone-aisle-column-shelf information into a single string rather than 4 separate columns,
Computing distances between sensors and farm locations, to determine what is the closest sensor to a batch,
Which farm region (Front farm, mid farm, back farm) each sensor in Tunnel 3 is in,
Yield per square metre for harvests,
Also the different queries related to crop batches now reuse as much code as possible.
Also includes a bunch of miscellaneous other changes done on the way, such as using a Jinja filter to format date strings and some bug fixes.
Cleaner, nicer code, and the harvest list query also happens to run much faster after these changes. Some things that used to be done by the web server and are now done by the Postgres server:
Also includes a bunch of miscellaneous other changes done on the way, such as using a Jinja filter to format date strings and some bug fixes.