File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
nowcasting_datamodel/read Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -226,16 +226,18 @@ def get_all_gsp_ids_latest_forecast(
226
226
227
227
query = query .filter (ForecastSQL .historic == historic )
228
228
229
- if preload_children :
230
- query = query .options (joinedload (ForecastSQL .location ))
231
- query = query .options (joinedload (ForecastSQL .model ))
232
- query = query .options (joinedload (ForecastSQL .input_data_last_updated ))
233
-
234
229
if start_target_time is not None :
235
230
query = filter_query_on_target_time (
236
231
query = query , start_target_time = start_target_time , historic = historic
237
232
)
238
233
234
+ if preload_children :
235
+ query = query .options (joinedload (ForecastSQL .location ))
236
+ query = query .options (joinedload (ForecastSQL .model ))
237
+ query = query .options (joinedload (ForecastSQL .input_data_last_updated ))
238
+ query = query .options (joinedload (ForecastSQL .forecast_values ))
239
+ query = query .options (joinedload (ForecastSQL .forecast_values_latest ))
240
+
239
241
query = query .order_by (LocationSQL .gsp_id , desc (ForecastSQL .created_utc ))
240
242
241
243
forecasts = query .populate_existing ().all ()
You can’t perform that action at this time.
0 commit comments