Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XNAT-Group
XNAT_Query_Client_XSA
Commits
3c015e67
Commit
3c015e67
authored
Jun 22, 2015
by
Franziska Koehn
Browse files
function get_field_key_by_label added
parent
7183ea83
Changes
1
Hide whitespace changes
Inline
Side-by-side
xsa/datatypereader.py
View file @
3c015e67
...
...
@@ -129,6 +129,20 @@ def get_field_label_by_key(root_type, field_key):
return
field_key
def
get_field_key_by_label
(
root_type
,
label
):
"""Returns the key of the given field-label.
**Parameters**
:root_type: str, Root-Type of label
:label: str, field-label, for which the key will be returned
"""
fields
=
get_fields
(
root_type
)
for
f
in
fields
:
if
f
[
'label'
]
==
label
:
return
f
[
"key"
]
return
label
def
get_field_label_by_field
(
root_type
,
field
):
"""
Returns the label of the given field.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment