sdu_bkjws/__init__.py
def _aodata(echo, columns, xnxq=None, final_exam=False):
        """
        生成用于post的数据

        :param echo: a int to check is response is write
        :type echo: int
        :param columns: 所有columns列名组成的list
        :type columns: list
        :param xnxq: str
        :type xnxq: string
        :param final_exam: 是否期末考试
        :rtype: bool
        :return: a valid data for post to get data
        """
        ao_data = [{"name": "sEcho", "value": echo},
                   {"name": "iColumns", "value": len(columns)},
                   {"name": "sColumns", "value": ""},
                   {"name": "iDisplayStart", "value": 0},
                   {"name": "iDisplayLength", "value": -1},
                   ]
        if xnxq:
            if final_exam:
                ao_data.append(
                    {"name": "ksrwid", "value": "000000005bf6cb6f015bfac609410d4b"})
            ao_data.append({"name": "xnxq", "value": xnxq})

        for index, value in enumerate(columns):
            ao_data.append(
                {"name": "mDataProp_{}".format(index), "value": value})
            ao_data.append(
                {"name": "bSortable_{}".format(index), "value": False})

        return urlencode({"aoData": ao_data})
def _aodata(echo, columns, xnxq=None, final_exam=False):
        """
        生成用于post的数据

        :param echo: a int to check is response is write
        :type echo: int
        :param columns: 所有columns列名组成的list
        :type columns: list
        :param xnxq: str
        :type xnxq: string
        :param final_exam: 是否期末考试
        :rtype: bool
        :return: a valid data for post to get data
        """
        ao_data = [{"name": "sEcho", "value": echo},
                   {"name": "iColumns", "value": len(columns)},
                   {"name": "sColumns", "value": ""},
                   {"name": "iDisplayStart", "value": 0},
                   {"name": "iDisplayLength", "value": -1},
                   ]
        if xnxq:
            if final_exam:
                ao_data.append(
                    {"name": "ksrwid", "value": "000000005bf6cb6f015bfac609410d4b"})
            ao_data.append({"name": "xnxq", "value": xnxq})

        for index, value in enumerate(columns):
            ao_data.append(
                {"name": "mDataProp_{}".format(index), "value": value})
            ao_data.append(
                {"name": "bSortable_{}".format(index), "value": False})

        return urlencode({"aoData": ao_data})
生成用于post的数据

        :param echo: a int to check is response is write
        :type echo: int
        :param columns: 所有columns列名组成的list
        :type columns: list
        :param xnxq: str
        :type xnxq: string
        :param final_exam: 是否期末考试
        :rtype: bool
        :return: a valid data for post to get data