Commit 5761bafc authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Cleaned search_model hiearchy.

parent 22510caa
......@@ -217,16 +217,7 @@ add_pagination_parameters(_archive_query_parser)
add_scroll_parameters(_archive_query_parser)
add_search_parameters(_archive_query_parser)
_archive_query_model_fields = {
'results': fields.List(fields.Raw, description=(
'A list of search results. Each result is a dict with quantities names as key and '
'values as values')),
'python': fields.String(description=(
'A string of python code snippet which can be executed to reproduce the api result.')),
'curl': fields.String(description=(
'A string of curl command which can be executed to reproduce the api result.')),
}
_archive_query_model = api.inherit('ArchiveCalculations', search_model, _archive_query_model_fields)
_archive_query_model = api.inherit('ArchiveCalculations', search_model)
@ns.route('/query')
......
......@@ -65,6 +65,10 @@ search_model = api.model('Search', {
'results': fields.List(fields.Raw, description=(
'A list of search results. Each result is a dict with quantitie names as key and '
'values as values')),
'python': fields.String(description=(
'A string of python code snippet which can be executed to reproduce the api result.')),
'curl': fields.String(description=(
'A string of curl command which can be executed to reproduce the api result.'))
})
......
......@@ -98,11 +98,7 @@ _repo_calcs_model_fields = {
'A dict with all statistics. Each statistic is dictionary with a metrics dict as '
'value and quantity value as key. The possible metrics are code runs(calcs), %s. '
'There is a pseudo quantity "total" with a single value "all" that contains the '
' metrics over all results. ' % ', '.join(datamodel.Domain.instance.metrics_names))),
'python': fields.String(description=(
'A string of python code snippet which can be executed to reproduce the api result.')),
'curl': fields.String(description=(
'A string of curl command which can be executed to reproduce the api result.')),
' metrics over all results. ' % ', '.join(datamodel.Domain.instance.metrics_names)))
}
for group_name, (group_quantity, _) in search.groups.items():
_repo_calcs_model_fields[group_name] = fields.Nested(api.model('RepoDatasets', {
......
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