From d423ec92c2e66dfbee4d03de778b6b4d46569d99 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Mon, 11 Mar 2024 15:05:51 +0000 Subject: [PATCH] Change from date to date_from and date_to --- app/records/schemas/search.py | 3 ++- app/sources/rosetta/api.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/records/schemas/search.py b/app/records/schemas/search.py index d154418..341ef14 100644 --- a/app/records/schemas/search.py +++ b/app/records/schemas/search.py @@ -5,7 +5,8 @@ class RecordSearchResult(APISearchResult): type: str = "" ref: str | None = None - date: str | None = None + date_from: str | None = None + date_to: str | None = None held_by: dict | None = None def __str__(self): diff --git a/app/sources/rosetta/api.py b/app/sources/rosetta/api.py index cd993d4..3025814 100644 --- a/app/sources/rosetta/api.py +++ b/app/sources/rosetta/api.py @@ -88,7 +88,8 @@ def parse_results( record.ref = parsed_data.reference_number() record.title = parsed_data.title() record.description = parsed_data.description() - record.date = parsed_data.date() + record.date_from = parsed_data.date_from() + record.date_to = parsed_data.date_to() record.held_by = parsed_data.held_by() # if highlight and "highLight" in r: # if "@template.details.summaryTitle" in r["highLight"]: @@ -123,9 +124,9 @@ def get_result(self) -> dict: for group in stats: self.add_parameter("filter", f"group:({group})") url = self.build_url() - print(url) + # print(url) raw_results = self.execute(url) - print(url) + # print(url) results_count = objects.get(raw_results, "stats.total") stats[group] = results_count return stats