Skip to content
Snippets Groups Projects
Commit 44c791ce authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Return the response payload in creation helpers

parent 499ac8b7
No related branches found
No related tags found
1 merge request!134Return the response payload in creation helpers
Pipeline #78820 passed
......@@ -132,6 +132,8 @@ class ClassificationMixin(object):
self.report.add_classification(element.id, ml_class)
return created
def create_classifications(self, element, classifications):
"""
Create multiple classifications at once on the given element through the API
......@@ -199,3 +201,5 @@ class ClassificationMixin(object):
logger.warning(
f"Couldn't save created classifications in local cache: {e}"
)
return created_cls
......@@ -104,7 +104,7 @@ class EntityMixin(object):
)
return
self.request(
transcription_ent = self.request(
"CreateTranscriptionEntity",
id=transcription,
body={
......@@ -130,3 +130,4 @@ class EntityMixin(object):
logger.warning(
f"Couldn't save created transcription entity in local cache: {e}"
)
return transcription_ent
......@@ -59,6 +59,8 @@ class TranscriptionMixin(object):
f"Couldn't save created transcription in local cache: {e}"
)
return created
def create_transcriptions(self, transcriptions):
"""
Create multiple transcriptions at once on existing elements through the API.
......@@ -114,6 +116,8 @@ class TranscriptionMixin(object):
f"Couldn't save created transcriptions in local cache: {e}"
)
return created_trs
def create_element_transcriptions(self, element, sub_element_type, transcriptions):
"""
Create multiple sub elements with their transcriptions on the given element through API
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment