コード例 #1
0
ファイル: crudoperations.py プロジェクト: vecna/GLBackend
    def get_tip_by_wb(self, receipt):

        requested_t = WhistleblowerTip(self.getStore())
        tip_description = requested_t.get_single(receipt)

        self.returnData(tip_description)
        self.returnCode(200)
        return self.prepareRetVals()
コード例 #2
0
ファイル: crudoperations.py プロジェクト: vecna/GLBackend
    def get_comment_list_by_wb(self, receipt):

        store = self.getStore()

        requested_t = WhistleblowerTip(store)
        tip_description = requested_t.get_single(receipt)

        comment_iface = Comment(store)
        comment_list = comment_iface.get_comment_by_itip(tip_description['internaltip_id'])

        self.returnData(comment_list)
        self.returnCode(200)
        return self.prepareRetVals()
コード例 #3
0
ファイル: crudoperations.py プロジェクト: vecna/GLBackend
    def new_comment_by_wb(self, receipt, request):

        store = self.getStore()

        requested_t = WhistleblowerTip(store)
        tip_description = requested_t.get_single(receipt)

        comment_iface = Comment(store)

        comment_stored = comment_iface.new(tip_description['internaltip_id'],
            request['content'], u"whistleblower")

        self.returnData(comment_stored)
        self.returnCode(201)
        return self.prepareRetVals()
コード例 #4
0
ファイル: crudoperations.py プロジェクト: vecna/GLBackend
    def get_receiver_list_by_wb(self, receipt):

        store = self.getStore()

        requested_t = WhistleblowerTip(store)
        tip_description = requested_t.get_single(receipt)

        receiver_iface = Receiver(store)

        itip_iface = InternalTip(store)
        # inforet = itip_iface.get_receivers_by_itip(tip_description['internaltip_id'])
        # the wb, instead get the list of active receiver, is getting the list of receiver
        # configured in the context:
        receivers_selected = itip_iface.get_single(tip_description['internaltip_id'])['receivers']

        inforet = []
        for receiver_gus in receivers_selected:
            inforet.append(receiver_iface.get_single(receiver_gus))

        self.returnData(inforet)
        self.returnCode(200)
        return self.prepareRetVals()