views.py 文件源码

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

项目:maple-file 作者: honmaple 项目源码 文件源码
def post(self):
        '''
        ????
        '''
        post_data = request.data
        user = request.user
        name = post_data.pop('name', None)
        description = post_data.pop('description', None)
        if name is None:
            msg = '????????'
            return HTTPResponse(
                HTTPResponse.HTTP_CODE_PARA_ERROR, message=msg).to_response()
        album = Album(name=name, user=user)
        if description is not None:
            album.description = description
        album.save()
        serializer = AlbumSerializer(album)
        return HTTPResponse(
            HTTPResponse.NORMAL_STATUS, data=serializer.data).to_response()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号