如何在基于类的ListView中使用Django-RQ?

时间:2018-05-16 23:31:05

标签: python django redis django-rq

我无法弄清楚如何在示例查询集中使用Django-RQ:

class PartnerCatalogueView(generic.ListView):
    """
    Browse all products in the catalogue
    """
    template_name = 'catalogue/partner.html'
    paginate_by = 9
    model = Product
    context_object_name = 'prod'

    def get_queryset(self, **kwargs):
        queryset = super(PartnerCatalogueView, 
         self).get_queryset()
        queryset = queryset.filter(stockrecords__partner__id=self.kwargs['pk'])
         return queryset

0 个答案:

没有答案