diff --git a/src/velofy/db/pixels.py b/src/velofy/db/pixels.py index e66bf1f..f202c2f 100644 --- a/src/velofy/db/pixels.py +++ b/src/velofy/db/pixels.py @@ -207,8 +207,7 @@ class Pixel(meta.Base): marker.add_to(self.grid.city.map) if restaurants: - # Obtain all primary `Address`es in the city that host `Restaurant`s - # and are in the `self` `Pixel` + # All primary `Address`es in the pixel that host `Restaurant`s addresses = db.session.scalars( sa.select(db.Address).where( db.Address.id.in_( @@ -242,13 +241,13 @@ class Pixel(meta.Base): tooltip = f"Restaurants {ids}" if order_counts: - # Calculate the number of orders for ALL restaurants ... + # Count the `Order`s of all `Restaurant`s at the `address` ... 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` + # ... and size the dot on the `.map` accordingly if n_orders >= 1000: radius = 20 elif n_orders >= 500: