Skip to content

Commit

Permalink
fix: add notes field to index
Browse files Browse the repository at this point in the history
resolves #95
  • Loading branch information
sennierer committed May 22, 2024
1 parent 42fc12b commit d2b43f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion viecpro_typesense_detail/details/detail_court.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
F("sources"), # TODO: give robin example of how to display sources, and format this accordingly
F("personnel"),
F("locations"),
F("hierarchy")
F("hierarchy"),
F("notes", type="string"),


]
Expand Down Expand Up @@ -132,6 +133,7 @@ def main(offset:int=0) -> Dict[str, Any]:
res["sources"] = get_references_for_instance(instance)
res["ampel"] = ampel(instance)
res["sameAs"] = [uri.uri for uri in instance.uri_set.all() if not uri.uri.startswith("https://viecpro.acdh.oeaw.ac.at")]
res["notes"] = instance.notes if instance.notes else ""

results.append(res)

Expand Down
2 changes: 2 additions & 0 deletions viecpro_typesense_detail/details/detail_institution.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
F("personnel"),
F("locations"),
F("hierarchy"),
F("notes", type="string"),
]


Expand Down Expand Up @@ -92,6 +93,7 @@ def main(offset: int = 0) -> Dict[str, Any]:
res["sources"] = get_references_for_instance(instance)
res["ampel"] = ampel(instance)
res["sameAs"] = [uri.uri for uri in instance.uri_set.all() if not uri.uri.startswith("https://viecpro.acdh.oeaw.ac.at")]
res["notes"] = instance.notes if instance.notes else ""

results.append(res)

Expand Down
2 changes: 2 additions & 0 deletions viecpro_typesense_detail/details/detail_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
# label_data and RelData Kirchliche Amtsbeziehung
F("relations_to_church_and_orders"),
F("non_court_functions"), # labelData other jobs
F("notes", type="string") #editorial notes
]

# unused atm, we only build the person collection (for now)
Expand Down Expand Up @@ -244,6 +245,7 @@ def main(offset: int = 0):
for uri in instance.uri_set.all()
if not uri.uri.startswith("https://viecpro.acdh.oeaw.ac.at")
]
res["notes"] = instance.notes if instance.notes else ""
results.append(res)

return {"schema": schema, "results": results}
4 changes: 3 additions & 1 deletion viecpro_typesense_detail/details/detail_place.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
F("alternative_names", type="string[]"),
F("person_relations"),
F("place_relations"),
F("institution_relations")
F("institution_relations"),
F("notes", type="string")
# TODO: add all fields


Expand Down Expand Up @@ -94,6 +95,7 @@ def main(offset:int=0) -> Dict[str, Any]:
res["model"] = model.__name__
res["ampel"] = ampel(instance)
res["sameAs"] = [uri.uri for uri in instance.uri_set.all() if not uri.uri.startswith("https://viecpro.acdh.oeaw.ac.at")]
res["notes"] = instance.notes if instance.notes else ""
results.append(res)

return {"schema":schema, "results":results}

0 comments on commit d2b43f1

Please sign in to comment.