From 2401160050548748079f8734eca1d3d9a090a8f8 Mon Sep 17 00:00:00 2001 From: Arne Gudermann Date: Thu, 21 Dec 2023 08:38:43 +0100 Subject: [PATCH] Readd skellist --- src/viur/core/render/json/default.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/viur/core/render/json/default.py b/src/viur/core/render/json/default.py index 01043091b..2f40a492d 100644 --- a/src/viur/core/render/json/default.py +++ b/src/viur/core/render/json/default.py @@ -100,27 +100,22 @@ def renderEntry(self, skel: SkeletonInstance | list[SkeletonInstance], actionNam def view(self, skel: SkeletonInstance, action: str = "view", params=None, **kwargs): return self.renderEntry(skel, action, params) - def list(self, skel_list: SkelList, action: str = "list", params=None, **kwargs): - if "skellist" in kwargs: - msg = f"parameter skellist in the 'list' method of the JSON Renderer is deprecated. " \ - f"Please use skel_list as the new parameter instead" - logging.warning(msg, stacklevel=3) - warnings.warn(msg, DeprecationWarning, stacklevel=3) - skel_list = kwargs["skellist"] + def list(self, skellist: SkelList, action: str = "list", params=None, **kwargs): + # Rendering the structure in lists is flagged as deprecated structure = None cursor = None orders = None - if skel_list: - if isinstance(skel_list[0], SkeletonInstance): + if skellist: + if isinstance(skellist[0], SkeletonInstance): if "json.bone.structure.inlists" in conf.compatibility: - structure = DefaultRender.render_structure(skel_list[0].structure()) + structure = DefaultRender.render_structure(skellist[0].structure()) - cursor = skel_list.getCursor() - orders = skel_list.get_orders() + cursor = skellist.getCursor() + orders = skellist.get_orders() - skellist = [skel.render_bone_values() for skel in skel_list] + skellist = [skel.render_bone_values() for skel in skellist] else: skellist = []