views.py 文件源码

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

项目:service-notifications 作者: rehive 项目源码 文件源码
def get(self, request, *args, **kwargs):
        company = request.user.company
        notification_id = kwargs['notification_id']

        try:
            note = Notification.objects.get(company=company, id=notification_id)
        except Notification.DoesNotExist:
            raise exceptions.NotFound()

        serializer = self.get_serializer(note)
        return Response({'status': 'success', 'data': serializer.data})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号