views.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:BackendAllStars 作者: belatrix 项目源码 文件源码
def employee_role_list(request):
    """
    Returns employee role full list
    ---
    serializer: employees.serializers.EmployeeRoleListSerializer
    responseMessages:
    - code: 401
      message: Unauthorized. Authentication credentials were not provided. Invalid token.
    - code: 403
      message: Forbidden.
    - code: 404
      message: Not found
    """
    if request.method == 'GET':
        role_list = get_list_or_404(Role)
        serializer = EmployeeRoleListSerializer(role_list, many=True)
        return Response(serializer.data, status=status.HTTP_200_OK)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号