コード例 #1
0
    def reply(self):
        if not self.controlpanel_name:
            raise BadRequest('Missing parameter controlpanelname')

        panel = self.panel_by_name(self.controlpanel_name)
        deserializer = IDeserializeFromJson(panel)
        deserializer()  # The deserializer knows where to put it.

        self.request.response.setStatus(204)
コード例 #2
0
ファイル: patch.py プロジェクト: tuxwerk/plone.restapi
    def reply(self):
        if not self.controlpanel_name:
            raise BadRequest("Missing parameter controlpanelname")

        panel = self.panel_by_name(self.controlpanel_name)
        deserializer = IDeserializeFromJson(panel)
        deserializer()  # The deserializer knows where to put it.

        return self.reply_no_content()
コード例 #3
0
ファイル: types.py プロジェクト: AlexBueckig/plone.restapi
    def update(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)
        deserializer = IDeserializeFromJson(self)
        return deserializer(context)
コード例 #4
0
ファイル: update.py プロジェクト: plone/plone.restapi
    def reply(self):
        if not self.params:
            raise BadRequest("Missing parameter controlpanelname")

        panel = self.panel_by_name(self.params[0])
        if len(self.params) > 1:
            # Update panel child
            panel.update(self.params[1:])
        else:
            # Update panel
            deserializer = IDeserializeFromJson(panel)
            deserializer()  # The deserializer knows where to put it.

        return self.reply_no_content()