Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
c81c5eed
Commit
c81c5eed
authored
5 years ago
by
Swen Vermeul
Browse files
Options
Downloads
Patches
Plain Diff
creating entity entity types, ongoing work
parent
ee16f191
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pybis/src/python/pybis/entity_type.py
+19
-16
19 additions, 16 deletions
pybis/src/python/pybis/entity_type.py
with
19 additions
and
16 deletions
pybis/src/python/pybis/entity_type.py
+
19
−
16
View file @
c81c5eed
...
@@ -97,6 +97,9 @@ class EntityType:
...
@@ -97,6 +97,9 @@ class EntityType:
"""
"""
pas
=
self
.
__dict__
[
'
_propertyAssignments
'
]
pas
=
self
.
__dict__
[
'
_propertyAssignments
'
]
# assign property type
property_type
=
self
.
openbis
.
get_property_type
(
property
)
new_assignment
=
{
new_assignment
=
{
"
section
"
:
section
,
"
section
"
:
section
,
"
ordinal
"
:
ordinal
,
"
ordinal
"
:
ordinal
,
...
@@ -104,26 +107,16 @@ class EntityType:
...
@@ -104,26 +107,16 @@ class EntityType:
"
initialValueForExistingEntities
"
:
initialValueForExistingEntities
,
"
initialValueForExistingEntities
"
:
initialValueForExistingEntities
,
"
showInEditView
"
:
showInEditView
,
"
showInEditView
"
:
showInEditView
,
"
showRawValueInForms
"
:
showRawValueInForms
,
"
showRawValueInForms
"
:
showRawValueInForms
,
"
propertyType
"
:
{
"
propertyType
"
:
property_type
.
data
,
"
permId
"
:
property
.
upper
(),
"
@type
"
:
"
as.dto.property.id.PropertyTypePermId
"
},
"
@type
"
:
"
as.dto.property.create.PropertyAssignmentCreation
"
,
"
@type
"
:
"
as.dto.property.create.PropertyAssignmentCreation
"
,
}
}
if
plugin
is
not
None
:
new_assignment
[
'
pluginId
'
]
=
{
"
permId
"
:
plugin
.
upper
(),
"
@type
"
:
"
as.dto.plugin.id.PluginPermId
"
}
pas
.
append
(
new_assignment
)
@property
# assign plugin
def
validationPlugin
(
self
):
if
plugin
is
not
None
:
try
:
plugin_obj
=
self
.
openbis
.
get_plugin
(
plugin
)
return
self
.
openbis
.
get_plugin
(
self
.
_validationPlugin
[
'
name
'
])
new_assignment
[
'
plugin
'
]
=
plugin_obj
.
data
except
Exception
:
pass
pas
.
append
(
new_assignment
)
def
revoke_property
(
self
,
def
revoke_property
(
self
,
property
,
property
,
...
@@ -138,6 +131,16 @@ class EntityType:
...
@@ -138,6 +131,16 @@ class EntityType:
raise
ValueError
(
"
not implemented yet
"
)
raise
ValueError
(
"
not implemented yet
"
)
@property
def
validationPlugin
(
self
):
"""
Returns a validation plugin object when called.
Returns None when no validation plugin is defined.
"""
try
:
return
self
.
openbis
.
get_plugin
(
self
.
_validationPlugin
[
'
name
'
])
except
Exception
:
pass
def
codes
(
self
):
def
codes
(
self
):
codes
=
[]
codes
=
[]
for
pa
in
self
.
data
[
'
propertyAssignments
'
]:
for
pa
in
self
.
data
[
'
propertyAssignments
'
]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment