Esempio n. 1
0
 def get(self, request):
     form = VideoSearchForm(data=request.GET)
     page = paginate(form.search(), self.page_size, request.GET.get('p'))
     video_list = Video.objects.filter(id__in=[obj.pk for obj in page.object_list])
     return self.render_to_response({
         'video_list': video_list,
         'page': page,
     })
Esempio n. 2
0
 def get(self, request):
     video_list = Video.objects.order_by('-created_on')
     video_list = paginate(video_list, self.page_size, request.GET.get('p'))
     return self.render_to_response({
         'video_list': video_list,
     })