diff libervia/pages/lists/create_from_tpl/page_meta.py @ 1509:106bae41f5c8

massive refactoring from camelCase -> snake_case. See backend commit log for more details
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:44:11 +0200
parents a84383c659b4
children
line wrap: on
line diff
--- a/libervia/pages/lists/create_from_tpl/page_meta.py	Fri Apr 07 15:20:40 2023 +0200
+++ b/libervia/pages/lists/create_from_tpl/page_meta.py	Sat Apr 08 13:44:11 2023 +0200
@@ -15,18 +15,18 @@
 
 
 def parse_url(self, request):
-    self.getPathArgs(request, ["template_id"])
+    self.get_path_args(request, ["template_id"])
 
 async def prepare_render(self, request):
-    data = self.getRData(request)
+    data = self.get_r_data(request)
     template_id = data["template_id"]
     if not template_id:
-        self.pageError(request, C.HTTP_BAD_REQUEST)
+        self.page_error(request, C.HTTP_BAD_REQUEST)
 
     template_data = request.template_data
-    profile = self.getProfile(request)
-    tpl_raw = await self.host.bridgeCall(
-        "listTemplateGet",
+    profile = self.get_profile(request)
+    tpl_raw = await self.host.bridge_call(
+        "list_template_get",
         template_id,
         "",
         profile,
@@ -36,20 +36,20 @@
     template_data["list_template"] = template
 
 async def on_data_post(self, request):
-    data = self.getRData(request)
+    data = self.get_r_data(request)
     template_id = data['template_id']
-    name, access = self.getPostedData(request, ('name', 'access'))
+    name, access = self.get_posted_data(request, ('name', 'access'))
     if access == 'private':
         access_model = 'whitelist'
     elif access == 'public':
         access_model = 'open'
     else:
         log.warning(f"Unknown access for template creation: {access}")
-        self.pageError(request, C.HTTP_BAD_REQUEST)
-    profile = self.getProfile(request)
+        self.page_error(request, C.HTTP_BAD_REQUEST)
+    profile = self.get_profile(request)
     try:
-        service, node = await self.host.bridgeCall(
-            "listTemplateCreate", template_id, name, access_model, profile
+        service, node = await self.host.bridge_call(
+            "list_template_create", template_id, name, access_model, profile
         )
     except BridgeException as e:
         if e.condition == "conflict":
@@ -58,7 +58,7 @@
             log.error(f"Can't create list from template: {e}")
             raise e
     data["post_redirect_page"] = (
-        self.getPageByName("lists"),
+        self.get_page_by_name("lists"),
         service,
         node or "@",
     )