Browse Source

swagger added

master
Mohsen Taba 3 weeks ago
parent
commit
ed0992e999
  1. 16
      apps/hadis/views/hadis.py
  2. 8
      apps/hadis/views/transmitter.py

16
apps/hadis/views/hadis.py

@ -863,6 +863,14 @@ class HadisCorrectionDetailView(RetrieveAPIView):
lookup_url_kwarg = 'correction_slug'
permission_classes = [AllowAny]
@swagger_auto_schema(
operation_summary="Get Hadis Correction Detail",
operation_description="Returns the full details of a specific hadis correction, including text, translations, and its book references.",
tags=['Dobodbi - Hadis (V2)'],
)
def get(self, request, *args, **kwargs):
return super().get(request, *args, **kwargs)
def get_queryset(self):
return HadisCorrection.objects.all().select_related(
'hadis'
@ -880,6 +888,14 @@ class HadisInterpretationDetailView(RetrieveAPIView):
lookup_url_kwarg = 'interpretation_slug'
permission_classes = [AllowAny]
@swagger_auto_schema(
operation_summary="Get Hadis Interpretation Detail",
operation_description="Returns the full details of a specific hadis interpretation, including text, translations, and its book references.",
tags=['Dobodbi - Hadis (V2)'],
)
def get(self, request, *args, **kwargs):
return super().get(request, *args, **kwargs)
def get_queryset(self):
return HadisInterpretation.objects.all().select_related(
'category'

8
apps/hadis/views/transmitter.py

@ -464,6 +464,14 @@ class TransmitterOriginalTextDetailView(RetrieveAPIView):
lookup_url_kwarg = 'original_text_slug'
permission_classes = [AllowAny]
@swagger_auto_schema(
operation_summary="Get Original Text Detail",
operation_description="Returns the full details of a specific original text belonging to a narrator, including its content, translations, and book references.",
tags=['Dobodbi - Hadis (V2)'],
)
def get(self, request, *args, **kwargs):
return super().get(request, *args, **kwargs)
def get_queryset(self):
return TransmitterOriginalText.objects.all().select_related(
'transmitter'

Loading…
Cancel
Save