diff --git a/vaccinate/core/views.py b/vaccinate/core/views.py index f89a4cb..7c04faa 100644 --- a/vaccinate/core/views.py +++ b/vaccinate/core/views.py @@ -90,6 +90,11 @@ def location(request, public_id): "location.html", { "location": location, + "derived_availability_and_inventory": json.dumps( + location.derive_availability_and_inventory()._asdict(), + indent=4, + default=lambda v: v.isoformat() if hasattr(v, "isoformat") else repr(v), + ), "source_locations": location.matched_source_locations.order_by( "-created_at" ).prefetch_related("concordances"), diff --git a/vaccinate/templates/location.html b/vaccinate/templates/location.html index 249daed..1a26289 100644 --- a/vaccinate/templates/location.html +++ b/vaccinate/templates/location.html @@ -7,6 +7,12 @@

{{ location }}

{{ location.public_id }} - {{ location.full_address }}

Find another location

+

Derived availability and inventory

+ +

We have logic that derives vaccine inventory and availability based on a combination of recently filed reports and recently scraped source locations. The location.derived_availability_and_inventory() method for this location currently returns:

+ +
{{ derived_availability_and_inventory }}
+ {% for title, content in api_previews %}

{{ title }}

{{ content }}