Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Jan 25, 2024
1 parent 2db9829 commit ccbe41e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/records/schemas/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Record(Details):
legal_status: str | None = None
closure_status: str | None = None
access_condition: str | None = None
notes: list[str] = []
languages: list[str] = []
related_materials: list[dict] = []
hierarchy: list[dict] = []
Expand Down Expand Up @@ -56,6 +57,7 @@ class Aggregation(Details):
legal_status: str | None = None
closure_status: str | None = None
access_condition: str | None = None
notes: list[str] = []
languages: list[str] = []
related_materials: list[dict] = []
hierarchy: list[dict] = []
Expand Down
2 changes: 2 additions & 0 deletions app/sources/rosetta/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def parse_results(self, raw_results, source_url):
record.legal_status = parsed_data.legal_status()
record.closure_status = parsed_data.closure_status()
record.access_condition = parsed_data.access_condition()
record.notes = parsed_data.notes()
record.languages = parsed_data.languages()
record.related_materials = parsed_data.related_materials()
record.hierarchy = (
Expand Down Expand Up @@ -198,6 +199,7 @@ def parse_results(self, raw_results, source_url):
record.legal_status = parsed_data.legal_status()
record.closure_status = parsed_data.closure_status()
record.access_condition = parsed_data.access_condition()
record.notes = parsed_data.notes()
record.languages = parsed_data.languages()
record.related_materials = parsed_data.related_materials()
record.hierarchy = (
Expand Down
9 changes: 8 additions & 1 deletion app/sources/rosetta/lib/response_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def reference_number(self) -> str | None:
None,
)
return None

def repository_url(self) -> str | None:
return objects.get(self.source, "repository.url")

Expand Down Expand Up @@ -849,3 +849,10 @@ def unpublished_finding_aids(self) -> str | None:
None,
)
return None

def notes(self) -> list[str] | None:
if "note" in self.source:
return [
note["value"] for note in self.source["note"] if "value" in note
]
return None

0 comments on commit ccbe41e

Please sign in to comment.