标签:imp status 信息 rgs framework 状态 frame stat header
from rest_framework.response import Response class APIResponse(Response): def __init__(self, data_status, msg, results=None, headers=None, status=None, **kwargs): ‘‘‘ :param data_status: 状态码 :param msg: 提示信息 :param results: 附加信息,如序列化得到的数据 :param headers: :param status: HTTP状态码 :param kwargs: 其他信息 ‘‘‘ data = { ‘status‘: data_status, ‘msg‘: msg, } if results: data[‘results‘] = results data.update(kwargs) super().__init__(data=data, headers=headers, status=status)
标签:imp status 信息 rgs framework 状态 frame stat header
原文地址:https://www.cnblogs.com/zhouze/p/11431649.html