From f025923d25619e3a511501dc017601e6dd16a333 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Fri, 4 Dec 2026 10:00:39 +0100 Subject: [PATCH] Explain the "why" --- src/velofy/db/cities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/velofy/db/cities.py b/src/velofy/db/cities.py index ef58531..a779efc 100644 --- a/src/velofy/db/cities.py +++ b/src/velofy/db/cities.py @@ -185,13 +185,13 @@ class City(meta.Base): ) if order_counts: - # Calculate the number of orders for ALL restaurants ... + # Several restaurants may share an address + # => Count the orders of all of them n_orders = db.session.execute( sa.select(sa.func.count(db.Order.id)) .join(db.Address, db.Order.pickup_address_id == db.Address.id) .where(db.Address.primary_id == address.id), ).scalar_one() - # ... and adjust the size of the red dot on the `.map` if n_orders >= 1000: radius = 20 elif n_orders >= 500: