yf_ymm 5 лет назад
Родитель
Сommit
ec3e9d032c
1 измененных файлов с 13 добавлено и 7 удалено
  1. 13 7
      apps/Equipment/views.py

+ 13 - 7
apps/Equipment/views.py

@@ -1456,21 +1456,27 @@ class My_Pub_List(ListView):
         if _type:
         if _type:
             _list = _list.filter(art_type=_type)
             _list = _list.filter(art_type=_type)
             if _type == "5":
             if _type == "5":
-                pub_list = CKArticle.objects.filter(art_type="5")
+                nums = CKArticle.objects.filter(art_type="5")
+                pub_list = CKArticle.objects.filter(art_type="5")[(10*(page-1)):(page*10)]
             elif _type == "6":
             elif _type == "6":
-                pub_list = Video_data.objects.all()
+                nums = Video_data.objects.all()
+                pub_list = Video_data.objects.all()[(10*(page-1)):(page*10)]
             elif _type == "7":
             elif _type == "7":
-                pub_list = Product.objects.all()
+                nums = Product.objects.all()
+                pub_list = Product.objects.all()[(10*(page-1)):(page*10)]
             elif _type == "8":
             elif _type == "8":
-                pub_list = Pick_Pub.objects.all()
+                nums = Pick_Pub.objects.all()
+                pub_list = Pick_Pub.objects.all()[(10*(page-1)):(page*10)]
             elif _type == "9":
             elif _type == "9":
-                pub_list = Hotel_Info.objects.all()
+                nums = Hotel_Info.objects.all()
+                pub_list = Hotel_Info.objects.all()[(10*(page-1)):(page*10)]
             elif _type == "10":
             elif _type == "10":
-                pub_list = Sightsee_Info.objects.all()
+                nums = Sightsee_Info.objects.all()
+                pub_list = Sightsee_Info.objects.all()[(10*(page-1)):(page*10)]
         if hidden:
         if hidden:
             _list = _list.filter(hidden=hidden)
             _list = _list.filter(hidden=hidden)
             pub_list = pub_list.filter(hidden=hidden)
             pub_list = pub_list.filter(hidden=hidden)
-        nums = _list.count()
+        # nums = _list.count()
         art_list = _list[(10*(page-1)):(page*10)]
         art_list = _list[(10*(page-1)):(page*10)]
         return render(request, 'backstageNet/infoList/myPubList.html', context={"pub_list":pub_list,"art_list":art_list,"nums":nums,"type":_type})
         return render(request, 'backstageNet/infoList/myPubList.html', context={"pub_list":pub_list,"art_list":art_list,"nums":nums,"type":_type})
     def post(self,request):
     def post(self,request):