This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add endpoints for single record details
- Loading branch information
Showing
20 changed files
with
875 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from .details import ( | ||
Details, | ||
ExternalRecord, | ||
Record, | ||
RecordArchive, | ||
RecordCreator, | ||
RecordCreatorPerson, | ||
) | ||
from .search import RecordSearchResult, RecordSearchResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class Details(BaseModel): | ||
type: str | ||
id: str = "" | ||
# dump: dict = {} # TEMP | ||
|
||
def __init__(self, id: str): | ||
super().__init__() | ||
self.id = id | ||
|
||
def toJSON(self): | ||
return self.__dict__ | ||
|
||
|
||
class Record(Details): | ||
type: str = "record" | ||
ref: str | None = None | ||
title: str = "" | ||
date: str = "" | ||
is_digitised: bool | None = None | ||
|
||
def __init__(self, id: str): | ||
super().__init__(id) | ||
|
||
|
||
class ExternalRecord(Details): | ||
type: str = "external_record" | ||
ref: str | None = None | ||
title: str = "" | ||
covering_date: str | None = None | ||
held_by: str | None = None | ||
|
||
def __init__(self, id: str): | ||
super().__init__(id) | ||
|
||
|
||
class RecordCreator(Details): | ||
type: str = "creator" | ||
name: str = "" | ||
date: str = "" | ||
places: list[str] = [] | ||
identifier: str = "" | ||
history: str = "" | ||
|
||
def __init__(self, id: str): | ||
super().__init__(id) | ||
|
||
|
||
class RecordCreatorPerson(RecordCreator): | ||
type: str = "person" | ||
name_parts: dict = {} | ||
date: str = "" | ||
gender: str = "" | ||
functions: str = "" | ||
biography: str = "" | ||
|
||
def __init__(self, id: str): | ||
super().__init__(id) | ||
|
||
|
||
class RecordArchive(Details): | ||
type: str = "archive" | ||
name: str = "" | ||
archon: str = "" | ||
places: list[str] = [] | ||
agents: dict = {} | ||
contact_info: dict = {} | ||
|
||
def __init__(self, id: str): | ||
super().__init__(id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
from .api_response import APIResponse | ||
from .api_result import APIResult | ||
from .filter import Filter | ||
from .common_filters_api import Filter | ||
from .common_search_api import APISearchResponse, APISearchResult |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .api import RosettaRecordDetails, RosettaRecordsSearch |
Oops, something went wrong.