From 2201fd2114a92e9d1c0ab3e307705582eb46613a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sabine=20Schr=C3=B6der?= <s.schroeder@fz-juelich.de> Date: Wed, 18 Nov 2020 11:37:55 +0100 Subject: [PATCH] #3: added kind of annotation to API for controlled vocabulary (and to pages) --- docs/toardb_fastapi.md | 4 ++++ toardb/toardb.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/docs/toardb_fastapi.md b/docs/toardb_fastapi.md index 31a81d7..9d2e0bf 100644 --- a/docs/toardb_fastapi.md +++ b/docs/toardb_fastapi.md @@ -420,6 +420,10 @@ [0, 'active', 'active'], [1, 'inactive', 'inactive'], [2, 'unknown', 'unknown']] +#### Kind Of Annotations #### + * Kind of Annotations: [ + [0, 'User', 'user comment'], + [1, 'Provider', 'provider comment']] #### Kind Of Organizations #### * Kind of Organizations: [ [1, 'Government', 'government'], diff --git a/toardb/toardb.py b/toardb/toardb.py index ca457c4..92f6893 100644 --- a/toardb/toardb.py +++ b/toardb/toardb.py @@ -24,6 +24,7 @@ async def info(): controlled_vocabulary = { "Role Codes": settings.RC_vocab, "Role Status": settings.RS_vocab, + "Kind of Annotations": settings.AK_vocab, "Kind of Organizations": settings.OK_vocab, "Data Access Rights": settings.DA_vocab, "Sampling Frequencies": settings.SF_vocab, @@ -48,6 +49,7 @@ async def info(name: str): controlled_vocabulary = { "Role Codes": settings.RC_vocab, "Role Status": settings.RS_vocab, + "Kind of Annotations": settings.AK_vocab, "Kind of Organizations": settings.OK_vocab, "Data Access Rights": settings.DA_vocab, "Sampling Frequencies": settings.SF_vocab, @@ -119,6 +121,7 @@ async def startup_event(): fake_cur = fake_conn.cursor() RC_vocabulary = __get_enum_dict(fake_cur, "rc_vocabulary") RS_vocabulary = __get_enum_dict(fake_cur, "rs_vocabulary") + AK_vocabulary = __get_enum_dict(fake_cur, "ak_vocabulary") OK_vocabulary = __get_enum_dict(fake_cur, "ok_vocabulary") DA_vocabulary = __get_enum_dict(fake_cur, "da_vocabulary") SF_vocabulary = __get_enum_dict(fake_cur, "sf_vocabulary") @@ -142,6 +145,7 @@ fake_conn = engine.raw_connection() fake_cur = fake_conn.cursor() RC_vocabulary = __get_enum_dict(fake_cur, "rc_vocabulary") RS_vocabulary = __get_enum_dict(fake_cur, "rs_vocabulary") +AK_vocabulary = __get_enum_dict(fake_cur, "ak_vocabulary") OK_vocabulary = __get_enum_dict(fake_cur, "ok_vocabulary") DA_vocabulary = __get_enum_dict(fake_cur, "da_vocabulary") SF_vocabulary = __get_enum_dict(fake_cur, "sf_vocabulary") @@ -164,6 +168,7 @@ class Settings(BaseSettings): Enumdict=namedtuple("Dict",["value","string","display_str"]) RC_vocab = RC_vocabulary RS_vocab = RS_vocabulary + AK_vocab = AK_vocabulary OK_vocab = OK_vocabulary DA_vocab = DA_vocabulary SF_vocab = SF_vocabulary -- GitLab