views.py 文件源码

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

项目:raposfly 作者: StreakyCobra 项目源码 文件源码
def get(self, request):
        """GET request for the list the history of purchases of the shop."""
        purchases = Purchase.objects.annotate(num_orders=Count('orders'))\
                                    .filter(num_orders__gt=0)
        paginator = LimitOffsetPagination()
        result_page = paginator.paginate_queryset(purchases, request)
        return Response(self.serializer_class(result_page, many=True).data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号