Commit 1f51d45a authored by Franziska Koehn's avatar Franziska Koehn
Browse files

method which returns a list of field keys of given root-type

parent b642652d
......@@ -83,6 +83,18 @@ def get_labels(root_type):
return []
def get_keys(root_type):
"""Returns a list of field-keys of a given root_type.
**Parameters**
:root_type: str, Root-Type of returned field-labels
"""
fields = get_fields(root_type)
if fields is not None:
return list(f['key'] for f in fields)
return []
def get_field_label_by_key(root_type, field_key):
"""Returns the label of the given field-key.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment