First stuff

This commit is contained in:
SebastianGode 2023-06-12 15:06:26 +02:00
parent c39be95a60
commit 6fbe471af5

View File

@ -112,6 +112,61 @@ class Services(object):
res[cat].setdefault("docs", [])
res[cat]["docs"].append(res_doc)
return res
def services_with_docs_type_and_title(self, environment=None):
"""Retrieve type and title from services and corresponding docs
:param str environment: Optional service environment. Influeces
"repository" field
"""
res = {}
service_list = []
service_dict = {}
# {
# "services": [
# {
# "name": ECS,
# "doc_types": [
# ...
# ]
# }
# ],
# "doc_types": [
# "umn",
# ]
doc_types = []
res = []
# for doc in self.all_docs_full(environment="public"):
# res.append(doc)
for service in self.all_services:
if not service["service_title"]:
continue
if not service["service_type"]:
continue
service_list.append({
"service_title": service["service_title"],
"service_type": service["service_type"]
})
# for doc in self.all_docs:
# doc_types.append(doc["type"])
# service_dict = {
# "name": services.get(
# }
return res
def docs_by_service_category(self, category, environment=None):
"""List services matching category