diff --git a/app/records/schemas/details.py b/app/records/schemas/details.py index 0d9b74c..8f8aaae 100644 --- a/app/records/schemas/details.py +++ b/app/records/schemas/details.py @@ -27,6 +27,8 @@ class Record(Details): administrative_background: str | None = None arrangement: str | None = None date: str | None = None + date_from: str | None = None + date_to: str | None = None is_digitised: bool | None = None held_by: dict = {} creators: list[dict] = [] diff --git a/app/sources/rosetta/api.py b/app/sources/rosetta/api.py index ce55b1c..59a177d 100644 --- a/app/sources/rosetta/api.py +++ b/app/sources/rosetta/api.py @@ -153,7 +153,7 @@ def parse_results(self, raw_results, source_url): try: parsed_data = RosettaResponseParser(raw_results) except Exception: - raise Exception("Respone is not recognised") + raise Exception("Response is not recognised") if ( parsed_data.type() == "record" or parsed_data.type() == "aggregation" @@ -170,7 +170,9 @@ def parse_results(self, raw_results, source_url): parsed_data.administrative_background() ) record.arrangement = parsed_data.arrangement() - record.date = parsed_data.date_range() + record.date = parsed_data.date() + record.date_from = parsed_data.date_from() + record.date_to = parsed_data.date_to() record.is_digitised = parsed_data.is_digitised() record.held_by = parsed_data.held_by() record.creators = parsed_data.creators() @@ -190,6 +192,7 @@ def parse_results(self, raw_results, source_url): else [] ) record.source_url = source_url + print(record.toJSON()) return record.toJSON() if ( parsed_data.type() == "archive"