From 1d6244afd18bc49ad94e2378fed98b08c4765d50 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Tue, 25 Jul 2023 11:25:52 +0100 Subject: [PATCH] expose dataset release date in more info bit of filter --- ...ataset_release_date.py => 0049_add_dataset_release_date.py} | 2 +- hub/templates/hub/explore.html | 1 + hub/views/explore.py | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) rename hub/migrations/{0042_add_dataset_release_date.py => 0049_add_dataset_release_date.py} (87%) diff --git a/hub/migrations/0042_add_dataset_release_date.py b/hub/migrations/0049_add_dataset_release_date.py similarity index 87% rename from hub/migrations/0042_add_dataset_release_date.py rename to hub/migrations/0049_add_dataset_release_date.py index b6057b910..b05490c92 100644 --- a/hub/migrations/0042_add_dataset_release_date.py +++ b/hub/migrations/0049_add_dataset_release_date.py @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ("hub", "0041_alter_dataset_subcategory"), + ("hub", "0048_alter_area_area_type"), ] operations = [ diff --git a/hub/templates/hub/explore.html b/hub/templates/hub/explore.html index dcf1d0827..c0c5905ce 100644 --- a/hub/templates/hub/explore.html +++ b/hub/templates/hub/explore.html @@ -59,6 +59,7 @@

${ filter.title }

Data from ${ filter.source_label }. + Last update: ${ filter.release_date }

diff --git a/hub/views/explore.py b/hub/views/explore.py index c6e1168f3..ba24a1a04 100644 --- a/hub/views/explore.py +++ b/hub/views/explore.py @@ -71,6 +71,9 @@ def render_to_response(self, context, **response_kwargs): is_range=d.is_range, data_type=d.data_type, ) + if d.release_date is not None: + ds["release_date"] = d.release_date + if ( type_map.get(d.name, None) is not None and type_map[d.name]["min"] is not None