|
|
|
@ -2,7 +2,8 @@ from rest_framework.views import APIView |
|
|
|
from rest_framework.response import Response |
|
|
|
from rest_framework import status |
|
|
|
|
|
|
|
from ..models import HadisSect, BookReference, Transmitters |
|
|
|
|
|
|
|
from ..models import HadisSect, BookReference, Transmitters ,Hadis ,HadisCategory |
|
|
|
from ..docs import hadis_info_swagger |
|
|
|
from apps.bookmark.models import Bookmark |
|
|
|
|
|
|
|
@ -14,7 +15,8 @@ class HadisInfoView(APIView): |
|
|
|
|
|
|
|
@hadis_info_swagger |
|
|
|
def get(self, request, *args, **kwargs): |
|
|
|
category_count = HadisSect.objects.filter(is_active=True).count() |
|
|
|
hadis_count = Hadis.objects.all().count() |
|
|
|
category_count = HadisCategory.objects.all().count() |
|
|
|
reference_count = BookReference.objects.count() |
|
|
|
bookmark_count = Bookmark.objects.filter( |
|
|
|
service=Bookmark.ServiceChoices.HADITH, |
|
|
|
@ -23,6 +25,7 @@ class HadisInfoView(APIView): |
|
|
|
narrator_count = Transmitters.objects.count() |
|
|
|
|
|
|
|
data = { |
|
|
|
'hadis_count':hadis_count, |
|
|
|
'category_count': category_count, |
|
|
|
'reference_count': reference_count, |
|
|
|
'bookmark_count': bookmark_count, |
|
|
|
|