Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add notes field to index #103

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}