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

Commit

Permalink
Optimisations, remove custom flake8 config, respond with null for unk…
Browse files Browse the repository at this point in the history
…nown fields
  • Loading branch information
ahosgood committed Jan 18, 2024
1 parent d1c60b3 commit 0c41e8c
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 138 deletions.
8 changes: 0 additions & 8 deletions .flake8

This file was deleted.

68 changes: 34 additions & 34 deletions app/records/schemas/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ def toJSON(self):

class Record(Details):
type: str = "record"
ref: str = ""
former_ref: str = ""
title: str = ""
description: str = ""
date: str = ""
ref: str | None = None
former_ref: str | None = None
title: str | None = None
description: str | None = None
date: str | None = None
is_digitised: bool | None = None
held_by: dict = {}
legal_status: str = ""
closure_status: str = ""
access_condition: str = ""
legal_status: str | None = None
closure_status: str | None = None
access_condition: str | None = None
languages: list[str] = []
hierarchy: list[dict] = []

Expand All @@ -36,21 +36,21 @@ def __init__(self, id: str):

class Aggregation(Details):
type: str = "aggregation"
iaid: str = ""
title: str = ""
description: str = ""
physical_description: str = ""
administrative_background: str = ""
arrangement: str = ""
date: str = ""
iaid: str | None = None
title: str | None = None
description: str | None = None
physical_description: str | None = None
administrative_background: str | None = None
arrangement: str | None = None
date: str | None = None
is_digitised: bool | None = None
held_by: dict = {}
creators: list[dict] = []
acquisition: list[dict] = []
unpublished_finding_aids: str = ""
legal_status: str = ""
closure_status: str = ""
access_condition: str = ""
unpublished_finding_aids: str | None = None
legal_status: str | None = None
closure_status: str | None = None
access_condition: str | None = None
languages: list[str] = []
hierarchy: list[dict] = []

Expand All @@ -60,11 +60,11 @@ def __init__(self, id: str):

class RecordCreator(Details):
type: str = "creator"
name: str = ""
date: str = ""
name: str | None = None
date: str | None = None
places: list[str] = []
identifier: str = ""
history: str = ""
identifier: str | None = None
history: str | None = None

def __init__(self, id: str):
super().__init__(id)
Expand All @@ -73,24 +73,24 @@ def __init__(self, id: str):
class RecordCreatorPerson(RecordCreator):
type: str = "person"
name_parts: dict = {}
date: str = ""
gender: str = ""
functions: str = ""
biography: str = ""
date: str | None = None
gender: str | None = None
functions: str | None = None
biography: str | None = None

def __init__(self, id: str):
super().__init__(id)


class RecordArchive(Details):
type: str = "archive"
name: str = ""
archon_code: str = ""
opening_times: str = ""
disabled_access: str = ""
information: str = ""
fee: str = ""
appointment: str = ""
name: str | None = None
archon_code: str | None = None
opening_times: str | None = None
disabled_access: str | None = None
information: str | None = None
fee: str | None = None
appointment: str | None = None
contact_info: dict = {}
places: list[str] = []
accumulation_dates: list[str] = []
Expand Down
Loading

0 comments on commit 0c41e8c

Please sign in to comment.