Avoid lazy loads in .__repr__()

`ReplaySimulation`, `ReplayedOrder`, and `Forecast` accessed
relationships in their `.__repr__()`, which emits queries
or fails for detached instances.

They now use the foreign key columns.
This commit is contained in:
Alexander Hess 2026-12-01 22:34:16 +01:00
commit 7d53abc057
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -52,7 +52,7 @@ class TestSpecialMethods:
assert (
result
== f"<Forecast: {forecast.prediction} for pixel ({forecast.pixel.n_x}|{forecast.pixel.n_y}) at {forecast.start_at}>" # noqa:E501
== f"<Forecast: {forecast.prediction} for pixel #{forecast.pixel_id} at {forecast.start_at}>" # noqa:E501
)