feat: split metadata into smal pieces

Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
This commit is contained in:
2023-06-02 07:20:02 +00:00
committed by zuul
parent 177ba3a3fa
commit bac06c250f
108 changed files with 1133 additions and 538 deletions

View File

@ -41,7 +41,7 @@ class Services(object):
# sort docs list by <service_type>_<title>
self._service_data["documents"] = sorted(
sorted_docs,
key=lambda x: f"{x.get('service_type')}{x.get('title')}"
key=lambda x: f"{x.get('service_type')}{x.get('title')}",
)
# sort services by <service_type>_<service_title>
self._service_data["services"] = sorted(
@ -216,15 +216,15 @@ class Services(object):
:param str service_type: Filter by service_type
"""
res = dict()
res['service'] = {}
res["service"] = {}
docs = []
services = self._service_data
for doc in services['documents']:
if doc['service_type'] == service_type:
for doc in services["documents"]:
if doc["service_type"] == service_type:
docs.append(doc)
res['documents'] = docs
for service in services['services']:
if service['service_type'] == service_type:
res['service'] = service
res["documents"] = docs
for service in services["services"]:
if service["service_type"] == service_type:
res["service"] = service
break
return res