def Get_Done(self, msg):
        """

        :param: msg the JSON message from the client
        :returns: The reply from the db driver
        :rvalue: str
        """

        done = msg['object']['done']
        item_ids = self.db.getDone(done)

        if item_ids is []:
            if done:
                e_msg = "Could not find any done itms"
            else:
                e_msg = "Could not find any undone itms"

            reply = {"status": "ERROR",
                     "type": "Done",
                     "object": {"msg": e_msg}}
        else:
            items = []
            for ii in item_ids:
                tmp = {}
                tmp['type'] = 'todo'
                tmp['obj'] = self.db.getItem(ii)
                items.append(tmp)

            reply = {"status": "OK",
                     "type": "Done",
                     "object": items}

        return reply
def Get_Done ( self , msg ) : done = msg [ 'object' ] [ 'done' ] item_ids = self . db . getDone ( done ) if item_ids is [ ] : if done : e_msg = "Could not find any done itms" else : e_msg = "Could not find any undone itms" reply = { "status" : "ERROR" , "type" : "Done" , "object" : { "msg" : e_msg } } else : items = [ ] for ii in item_ids : tmp = { } tmp [ 'type' ] = 'todo' tmp [ 'obj' ] = self . db . getItem ( ii ) items . append ( tmp ) reply = { "status" : "OK" , "type" : "Done" , "object" : items } return reply
:param: msg the JSON message from the client
        :returns: The reply from the db driver
        :rvalue: str