From c5be06fb575ddd7f81a9f93900f5514615c99493 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Fri, 4 Dec 2026 16:12:58 +0100 Subject: [PATCH] Properly rephrase --- src/velofy/db/addresses_pixels.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/velofy/db/addresses_pixels.py b/src/velofy/db/addresses_pixels.py index 1d6d496..d11b729 100644 --- a/src/velofy/db/addresses_pixels.py +++ b/src/velofy/db/addresses_pixels.py @@ -10,8 +10,9 @@ from velofy.db import meta class AddressPixelAssociation(meta.Base): """Association pattern between `Address` and `Pixel`. - This approach is needed here mainly because it implicitly - updates the `city_id` and `grid_id` columns. + A plain many-to-many relationship would only set `.address_id` and `.pixel_id`. + This class also copies `.city_id` from the `Address` and `.grid_id` from + the `Pixel`, which the composite foreign keys need for their checks. See: https://docs.sqlalchemy.org/en/stable/orm/basic_relationships.html#association-object