摘要:
Abstract base classes 如果你想把某些公共信息添加到很多 model 中,抽象基类就显得非常有用。你编写完基类之后,在 Meta 内嵌类中设置 abstract=True ,该类就不能创建任何数据表。然而如果将它做为其他 model 的基类,那么该类的字段就会被添加到子类中。抽象 阅读全文
摘要:
Response封装 utils/response.py from rest_framework.response import Response class APIResponse(Response): def __init__(self, status=100, msg='success', h 阅读全文