updated version
This commit is contained in:
parent
2c5b6956c8
commit
e16c7fc177
|
|
@ -6,12 +6,12 @@
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="b5202e0c-6ddf-4a56-a13a-e18798c4c7cf" name="Changes" comment="">
|
<list default="true" id="b5202e0c-6ddf-4a56-a13a-e18798c4c7cf" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Events/AllEvents/authentication/auth/function_handlers.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/authentication/auth/function_handlers.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ApiLayers/AllConfigs/Redis/configs.py" beforeDir="false" afterPath="$PROJECT_DIR$/ApiLayers/AllConfigs/Redis/configs.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Events/AllEvents/events/account/bases.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/events/account/bases.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Events/AllEvents/events/account/cluster.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/events/account/cluster.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Events/AllEvents/events/account/cluster.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/events/account/cluster.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Events/AllEvents/events/account/function_handlers.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/events/account/function_handlers.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Events/AllEvents/events/account/info.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/events/account/info.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Events/AllEvents/events/account/info.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/events/account/info.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Events/AllEvents/validations/validation/function_handlers.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/AllEvents/validations/validation/function_handlers.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Events/Engine/abstract_class.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/Engine/abstract_class.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Events/Engine/abstract_class.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/Engine/abstract_class.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Events/base_request_model.py" beforeDir="false" afterPath="$PROJECT_DIR$/Events/base_request_model.py" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"git-widget-placeholder": "development",
|
"git-widget-placeholder": "development",
|
||||||
"last_opened_file_path": "/home/berkay/git-gitea-evyos/wag-managment-api-service-version-5/Events/AllEvents/events/project_decision_book/project_decision_book_person"
|
"last_opened_file_path": "/home/berkay/git-try-from/django-starter-project"
|
||||||
}
|
}
|
||||||
}</component>
|
}</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ class RedisAuthKeys:
|
||||||
AUTH: str = "AUTH"
|
AUTH: str = "AUTH"
|
||||||
OCCUPANT: str = "OCCUPANT"
|
OCCUPANT: str = "OCCUPANT"
|
||||||
EMPLOYEE: str = "EMPLOYEE"
|
EMPLOYEE: str = "EMPLOYEE"
|
||||||
|
CACHE: str = "CACHE"
|
||||||
|
|
||||||
|
|
||||||
class RedisCategoryKeys:
|
class RedisCategoryKeys:
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@ class KeyValidations:
|
||||||
data = "data"
|
data = "data"
|
||||||
validation = "validations"
|
validation = "validations"
|
||||||
|
|
||||||
|
# Key URLS for the cluster
|
||||||
|
class KeyURLs:
|
||||||
|
validations = "/validations/validations"
|
||||||
|
|
||||||
# Keys for the cluster
|
# Keys for the cluster
|
||||||
class KeyBases:
|
class KeyBases:
|
||||||
|
|
@ -27,7 +30,9 @@ class PageBases:
|
||||||
DASHBOARD = f"/dashboard?{DefaultClusterName}={cluster_name}"
|
DASHBOARD = f"/dashboard?{DefaultClusterName}={cluster_name}"
|
||||||
|
|
||||||
|
|
||||||
class Page2Keys:
|
# Match the keys with the pages
|
||||||
KeyBases.create_key = PageBases.CREATE
|
page_2_keys = {
|
||||||
KeyBases.update_key = PageBases.UPDATE
|
KeyBases.create_key: PageBases.CREATE,
|
||||||
KeyBases.list_key = PageBases.DASHBOARD
|
KeyBases.update_key: PageBases.UPDATE,
|
||||||
|
KeyBases.list_key: PageBases.DASHBOARD,
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ from .account_records import (
|
||||||
AccountRecordsCreateEventMethods,
|
AccountRecordsCreateEventMethods,
|
||||||
AccountRecordsUpdateEventMethods,
|
AccountRecordsUpdateEventMethods,
|
||||||
)
|
)
|
||||||
from .bases import cluster_name, prefix
|
from .bases import cluster_name, prefix, page_2_keys
|
||||||
from .info import page_infos
|
from .info import page_infos
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -19,6 +19,7 @@ AccountCluster = CategoryCluster(
|
||||||
"AccountRecordsUpdateEventMethods": AccountRecordsUpdateEventMethods,
|
"AccountRecordsUpdateEventMethods": AccountRecordsUpdateEventMethods,
|
||||||
"AccountRecordsListEventMethods": AccountRecordsListEventMethods,
|
"AccountRecordsListEventMethods": AccountRecordsListEventMethods,
|
||||||
},
|
},
|
||||||
|
mapping=page_2_keys,
|
||||||
include_in_schema=True,
|
include_in_schema=True,
|
||||||
sub_category=[],
|
sub_category=[],
|
||||||
is_client=True,
|
is_client=True,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
from Events.Engine.abstract_class import PageInfo
|
from Events.Engine.abstract_class import PageInfo
|
||||||
from .bases import KeyValidations, cluster_name, KeyBases, PageBases, icon
|
from .bases import KeyValidations, cluster_name, KeyBases, PageBases, icon, KeyURLs
|
||||||
from .account_records import (
|
from .account_records import (
|
||||||
AccountRecordsUpdateEventMethods,
|
AccountRecordsUpdateEventMethods,
|
||||||
AccountRecordsCreateEventMethods,
|
AccountRecordsCreateEventMethods,
|
||||||
|
|
@ -33,7 +33,7 @@ class ClustersPageInfo:
|
||||||
str(KeyBases.list_key): {
|
str(KeyBases.list_key): {
|
||||||
"headers": {
|
"headers": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/header",
|
"url": KeyURLs.validations,
|
||||||
"data": {"event_code": f"{KeyBases.list_key}", "asked_field": KeyValidations.headers},
|
"data": {"event_code": f"{KeyBases.list_key}", "asked_field": KeyValidations.headers},
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
|
|
@ -65,12 +65,12 @@ class ClustersPageInfo:
|
||||||
str(KeyBases.create_key): {
|
str(KeyBases.create_key): {
|
||||||
"validation": {
|
"validation": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/validation",
|
"url": KeyURLs.validations,
|
||||||
"data": {"event_code": f"{KeyBases.create_key}", "asked_field": KeyValidations.validation },
|
"data": {"event_code": f"{KeyBases.create_key}", "asked_field": KeyValidations.validation },
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/header",
|
"url": KeyURLs.validations,
|
||||||
"data": {"event_code": f"{KeyBases.create_key}", "asked_field": KeyValidations.headers},
|
"data": {"event_code": f"{KeyBases.create_key}", "asked_field": KeyValidations.headers},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -91,7 +91,6 @@ class ClustersPageInfo:
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
update_page_info = PageInfo(
|
update_page_info = PageInfo(
|
||||||
name=f"{cluster_name}",
|
name=f"{cluster_name}",
|
||||||
url=PageBases.UPDATE,
|
url=PageBases.UPDATE,
|
||||||
|
|
@ -100,12 +99,12 @@ class ClustersPageInfo:
|
||||||
str(KeyBases.update_key): {
|
str(KeyBases.update_key): {
|
||||||
"validation": {
|
"validation": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/validation",
|
"url": KeyURLs.validations,
|
||||||
"data": {"event_code": f"{KeyBases.update_key}", "asked_field": KeyValidations.validation},
|
"data": {"event_code": f"{KeyBases.update_key}", "asked_field": KeyValidations.validation},
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"store": True,
|
"store": True,
|
||||||
"url": "/validations/header",
|
"url": KeyURLs.validations,
|
||||||
"data": {"event_code": f"{KeyBases.update_key}", "asked_field": KeyValidations.headers},
|
"data": {"event_code": f"{KeyBases.update_key}", "asked_field": KeyValidations.headers},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ class RetrievePage(BaseRouteModel):
|
||||||
prefix=cluster_name.PREFIX,
|
prefix=cluster_name.PREFIX,
|
||||||
url=dict(page_info).get("url", None),
|
url=dict(page_info).get("url", None),
|
||||||
icon=dict(page_info).get("icon", None),
|
icon=dict(page_info).get("icon", None),
|
||||||
|
mapping=cluster_name.MAPPING,
|
||||||
page_info=dict(page_info).get("page_info", None),
|
page_info=dict(page_info).get("page_info", None),
|
||||||
endpoints={},
|
endpoints={},
|
||||||
language_models={},
|
language_models={},
|
||||||
|
|
|
||||||
|
|
@ -266,8 +266,9 @@ class CategoryCluster:
|
||||||
PREFIX: str
|
PREFIX: str
|
||||||
PAGEINFO: Optional[Dict["str", PageInfo]]
|
PAGEINFO: Optional[Dict["str", PageInfo]]
|
||||||
DESCRIPTION: str
|
DESCRIPTION: str
|
||||||
ENDPOINTS: dict[str, MethodToEvent] # {"MethodToEvent": MethodToEvent, ...}
|
ENDPOINTS: dict[str, MethodToEvent] # {"MethodToEvent": MethodToEvent, ...}
|
||||||
SUBCATEGORY: Optional[List["CategoryCluster"]] # [CategoryCluster, ...]
|
SUBCATEGORY: Optional[List["CategoryCluster"]] # [CategoryCluster, ...]
|
||||||
|
MAPPING: Optional[List[Dict[str, Any]]] # [{"key": "value"}, ...]
|
||||||
INCLUDE_IN_SCHEMA: Optional[bool] = True
|
INCLUDE_IN_SCHEMA: Optional[bool] = True
|
||||||
IS_CLIENT: Optional[bool] = False
|
IS_CLIENT: Optional[bool] = False
|
||||||
|
|
||||||
|
|
@ -279,6 +280,7 @@ class CategoryCluster:
|
||||||
description: str,
|
description: str,
|
||||||
endpoints: dict[str, MethodToEvent],
|
endpoints: dict[str, MethodToEvent],
|
||||||
sub_category: list,
|
sub_category: list,
|
||||||
|
mapping: Optional[List[Dict[str, Any]]] = None,
|
||||||
pageinfo: Optional[Dict["str", PageInfo]] = None,
|
pageinfo: Optional[Dict["str", PageInfo]] = None,
|
||||||
include_in_schema: Optional[bool] = True,
|
include_in_schema: Optional[bool] = True,
|
||||||
is_client: Optional[bool] = False,
|
is_client: Optional[bool] = False,
|
||||||
|
|
@ -291,6 +293,7 @@ class CategoryCluster:
|
||||||
self.ENDPOINTS = endpoints or {}
|
self.ENDPOINTS = endpoints or {}
|
||||||
self.SUBCATEGORY = sub_category or []
|
self.SUBCATEGORY = sub_category or []
|
||||||
self.INCLUDE_IN_SCHEMA = include_in_schema
|
self.INCLUDE_IN_SCHEMA = include_in_schema
|
||||||
|
self.MAPPING = mapping
|
||||||
self.IS_CLIENT = is_client
|
self.IS_CLIENT = is_client
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
@ -341,16 +344,16 @@ class CategoryCluster:
|
||||||
def retrieve_page_info(self):
|
def retrieve_page_info(self):
|
||||||
"""
|
"""
|
||||||
PAGE_INFO:ClusterToMethod = {"PageInfo": {...}, "subCategory": PAGE_INFO:ClusterToMethod}
|
PAGE_INFO:ClusterToMethod = {"PageInfo": {...}, "subCategory": PAGE_INFO:ClusterToMethod}
|
||||||
return {"prefix": self.PREFIX, **page_info}
|
return {"prefix": self.PREFIX, "mapping": self.MAPPING, **page_infos}
|
||||||
"""
|
"""
|
||||||
page_infos = {}
|
page_infos = {}
|
||||||
if isinstance(self.PAGEINFO, dict):
|
if isinstance(self.PAGEINFO, dict):
|
||||||
for page_key, page_info in dict(self.PAGEINFO).items():
|
for page_key, page_info in dict(self.PAGEINFO).items():
|
||||||
if page_info_dict := getattr(page_info, "as_dict", None):
|
if page_info_dict := getattr(page_info, "as_dict", None):
|
||||||
page_infos[page_key] = page_info_dict
|
page_infos[page_key] = page_info_dict
|
||||||
return {"prefix": self.PREFIX, **page_infos}
|
return {"prefix": self.PREFIX, "mapping": self.MAPPING, **page_infos}
|
||||||
if hasattr(self.PAGEINFO, "as_dict"):
|
if hasattr(self.PAGEINFO, "as_dict"):
|
||||||
return {"prefix": self.PREFIX, **self.PAGEINFO.as_dict}
|
return {"prefix": self.PREFIX, "mapping": self.MAPPING, **self.PAGEINFO.as_dict}
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue