Skip to content
Snippets Groups Projects
Commit 098de55f authored by Swen Vermeul's avatar Swen Vermeul
Browse files

added create, update and delete types for PropertyType and Sample

parent 139a60c9
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ def openbis_definitions(entity):
"identifier": "sampleId",
"create": { "@type": "as.dto.sample.create.SampleCreation"},
"update": { "@type": "as.dto.sample.upate.SampleUpdate"},
"delete": { "@type": "as.dto.sample.delete.SampleDeletionOptions"},
"cre_type": "as.dto.sample.create.SampleCreation",
"multi": "parents children components tags attachments".split(),
},
......@@ -57,14 +58,29 @@ def openbis_definitions(entity):
"attrs_up": "autoGeneratedCode generatedCodePrefix subcodeUnique description listable showContainer showParents showParentMetadata".split(),
"attrs": "code autoGeneratedCode generatedCodePrefix subcodeUnique description listable showContainer showParents showParentMetadata".split(),
"create": {
"@type": "as.dto.sample.create.SampleTypeCreation"
},
"update": {
"@type": "as.dto.sample.update.SampleTypeUpdate"
},
"delete": {
"@type": "as.dto.sample.delete.SampleTypeDeletionOptions"
},
},
"propertyType": {
"attrs": "code label description managedInternally internalNameSpace dataType vocabulary materialType schema transformation semanticAnnotations registrator registrationDate".split(),
"attrs_new": "code label description managedInternally internalNameSpace dataType vocabularyId materialTypeId schema transformation metaData".split(),
"attrs_up": "label description schema transformation metaData".split(),
"create": {
"@type": "as.dto.property.create.PropertyTypeCreation"
},
"update": {
"@type": "as.dto.property.update.PropertyTypeUpdate"
},
"delete": {
"@type": "as.dto.property.delete.PropertyTypeDeletionOptions"
},
},
"SemanticAnnotation": {
"attrs_new": "permId entityType propertyType predicateOntologyId predicateOntologyVersion predicateAccessionId descriptorOntologyId descriptorOntologyVersion descriptorAccessionId".split(),
......@@ -260,6 +276,10 @@ fetch_option = {
"@type": "as.dto.person.fetchoptions.PersonFetchOptions"
},
},
"semanticAnnotations": {
"@type": "as.dto.semanticannotation.fetchoptions.SemanticAnnotationFetchOptions"
},
"materialType": { "@type": "as.dto.material.fetchoptions.MaterialTypeFetchOptions" },
"tags": {"@type": "as.dto.tag.fetchoptions.TagFetchOptions"},
"tag": {"@type": "as.dto.tag.fetchoptions.TagFetchOptions"},
"attachments": {"@type": "as.dto.attachment.fetchoptions.AttachmentFetchOptions"},
......@@ -277,9 +297,9 @@ fetch_option = {
"plugin": {"@type": "as.dto.plugin.fetchoptions.PluginFetchOptions"},
"vocabulary": {
"@type": "as.dto.vocabulary.fetchoptions.VocabularyFetchOptions",
"terms": {
"@type": "as.dto.vocabulary.fetchoptions.VocabularyTermFetchOptions"
},
#"terms": {
# "@type": "as.dto.vocabulary.fetchoptions.VocabularyTermFetchOptions"
#},
},
"vocabularyTerm": {"@type": "as.dto.vocabulary.fetchoptions.VocabularyTermFetchOptions"},
"deletedObjects": { "@type": "as.dto.deletion.fetchoptions.DeletedObjectFetchOptions" },
......@@ -301,7 +321,11 @@ def get_type_for_entity(entity, action):
return definition[action]
def get_method_for_entity(entity, action):
if action == "Vocabulary":
action = action.lower()
if entity == "Vocabulary":
return "{}Vocabularies".format(action)
if entity == "propertyType":
return "{}PropertyTypes".format(action)
return "{}{}s".format(action, entity)
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