def get(self, names): name = names[0] if IPloneRestapiLayer.providedBy(self.request): noLongerProvides(self.request, IPloneRestapiLayer) context = queryMultiAdapter((self.context, self.request), name='dexterity-types') context = context.publishTraverse(self.request, name) serializer = ISerializeToJson(self) return serializer(context)
def reply_panel(self): name = self.params[0] panel = self.panel_by_name(name) if panel is None: self.request.response.setStatus(404) return # Panel child request if len(self.params) > 1: return IJsonCompatible(panel.get(self.params[1:])) # Panel request return IJsonCompatible(ISerializeToJson(panel)())
def reply_panel(self): panel = self.panel_by_name(self.controlpanel_name) if panel is None: self.request.response.setStatus(404) return return IJsonCompatible(ISerializeToJson(panel)())