Хочу сделать пагинацию с помощью MultipleObjectMixin. Но вылетает:
'ListingCakeView' object has no attribute 'object_list'
class ListingCakeView(MultipleObjectMixin,TemplateResponseMixin, View):
paginate_by = 1
model = CakeModel
template_name = 'list_cakes.html'
def post(self,request, context, **kwargs):
return render_to_response(request, context)
def get_context_data(self, **kwargs):
context = super(ListingCakeView,self).get_context_data(**kwargs)
paginator, page, cakes, is_paginate = self.paginate_queryset(self.get_queryset() ,
self.paginate_by)
context['page'] = page
return context
def get(self, request, **kwargs):
return self.render_to_response(self.get_context_data(**kwargs), **kwargs)