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

Import scripts: update references to TextChoices #188

Merged
merged 3 commits into from
Sep 4, 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
17 changes: 10 additions & 7 deletions apis_ontology/scripts/import_nonbibl_entities_from_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@
}

RELEVANCIES = {
"H": "protagonist",
"N": "supporting_character",
"E": "referenced_character",
"H": "Hauptfigur",
"N": "Nebenfigur",
"E": "erwähnte Figur",
}

FICTIONALITY_DEGREES = {
"F": "fictional_character",
"M": "mythical_character",
"R": "historical_character",
"M/R": ["mythical_character", "historical_character"],
"F": "fiktive Figur",
"M": "mythologische Figur",
"R": "historische Figur",
"M/R": [
"historische Figur",
"mythologische Figur",
],
}


Expand Down
10 changes: 1 addition & 9 deletions apis_ontology/scripts/import_zotero_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,14 +400,6 @@ def get_valid_collection_items(collection_items):
return importable, not_importable


def get_manifestation_type(collection_name):
available_manifestation_types = Expression.ManifestationTypes
manifestation_type = [
x for x in available_manifestation_types if x.label in collection_name
]
return manifestation_type


def get_edition_types_from_tags(tags):
"""
Check if a Zotero collection item's tags contain valid
Expand All @@ -416,7 +408,7 @@ def get_edition_types_from_tags(tags):
:param tags: a list of strings
:return: a list of strings
"""
valid_tags = [t.value for t in Expression.EditionTypes if t.label in tags]
valid_tags = [t.value for t in Expression.EditionTypes.choices if t.label in tags]

return valid_tags

Expand Down
Loading