From 3c550ac0240d7fd4737d62aa106fc06aca93e06c Mon Sep 17 00:00:00 2001 From: mohsentaba Date: Tue, 23 Dec 2025 15:10:27 +0330 Subject: [PATCH] little api debugs --- apps/hadis/docs.py | 33 ++------------------------------- apps/hadis/serializers/hadis.py | 2 +- apps/hadis/urls.py | 2 +- 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/apps/hadis/docs.py b/apps/hadis/docs.py index 05e5b4b..b43bfef 100644 --- a/apps/hadis/docs.py +++ b/apps/hadis/docs.py @@ -1294,32 +1294,14 @@ transmitter_original_text_swagger = swagger_auto_schema( "id": 1, "title": "On the Importance of Intention", "text": "إنما الأعمال بالنيات وإنما لكل امرئ ما نوى. فمن كانت هجرته إلى الله ورسوله فهجرته إلى الله ورسوله، ومن كانت هجرته لدنيا يصيبها أو امرأة ينكحها فهجرته إلى ما هاجر إليه", - "translation": [ - { - "language_code": "en", - "text": "Actions are but by intention, and every person will have what they intended. So whoever emigrated for Allah and His Messenger, then his emigration is for Allah and His Messenger. And whoever emigrated for worldly gain or to marry a woman, then his emigration is for that which he emigrated." - }, - { - "language_code": "fa", - "text": "اعمال به نیت ها است و هر کس آنچه را که قصد کرده است خواهد داشت. پس هر کس برای خدا و پیامبرش هجرت کند، هجرت او برای خدا و پیامبرش است. و هر کس برای منافع دنیوی یا ازدواج با زنی هجرت کند، هجرت او برای همان چیزی است که برای آن هجرت کرده است." - } - ], + "translation":"Actions are but by intention, and every person will have what they intended. So whoever emigrated for Allah and His Messenger, then his emigration is for Allah and His Messenger. And whoever emigrated for worldly gain or to marry a woman, then his emigration is for that which he emigrated.", "share_link": "http://example.com/narrators/56/texts/1" }, { "id": 2, "title": "On Knowledge and Learning", "text": "طلب العلم فريضة على كل مسلم ومسلمة", - "translation": [ - { - "language_code": "en", - "text": "Seeking knowledge is obligatory upon every Muslim, male and female" - }, - { - "language_code": "fa", - "text": "طلب علم بر هر مسلمان و مسلمانی واجب است" - } - ], + "translation":"Actions are but by intention, and every person will have what they intended. So whoever emigrated for Allah and His Messenger, then his emigration is for Allah and His Messenger. And whoever emigrated for worldly gain or to marry a woman, then his emigration is for that which he emigrated.", "share_link": "http://example.com/narrators/56/texts/2" } ] @@ -2334,17 +2316,6 @@ hadis_main_list_swagger = swagger_auto_schema( "count": 150, "next": "http://example.com/api/hadis/arguments/?page=2", "previous": None, - "categories": [ - "Faith Fundamentals", - "Prayer Rites", - "Fasting Practices", - "Pilgrimage Guide" - ], - "statuses": [ - "Authentic (Sahih)", - "Good (Hasan)", - "Weak (Da'if)" - ], "results": [ { "id": 1, diff --git a/apps/hadis/serializers/hadis.py b/apps/hadis/serializers/hadis.py index dab495f..fea14eb 100644 --- a/apps/hadis/serializers/hadis.py +++ b/apps/hadis/serializers/hadis.py @@ -120,7 +120,7 @@ class HadisSyncSerializer(serializers.ModelSerializer): transmitters_data.append({ 'id': t.id, 'name': get_localized_text(t.full_name, request), - 'reliability': t.reliability, + 'reliability': get_localized_text(t.reliability,request), 'layer_level': layer.number if layer else None, 'layer_name': get_localized_text(layer.name, request) if layer else None, 'is_gap': transmitter_rel.is_gap, diff --git a/apps/hadis/urls.py b/apps/hadis/urls.py index 3d8d1f4..57a2c11 100644 --- a/apps/hadis/urls.py +++ b/apps/hadis/urls.py @@ -32,8 +32,8 @@ urlpatterns = [ path('narrators//opinions', TransmitterOpinionView.as_view(), name='narrator-opinions'), path('narrators//original_texts', TransmitterOriginalTextView.as_view(), name='narrator-original-texts'), path('narrators/', TransmitterDetailView.as_view(), name='narrator-detail'), - path('narrators/', TransmitterView.as_view(), name='narrators'), path('narrators/filters/', TransmitterFiltersView.as_view(), name='narrator-filters'), + path('narrators/', TransmitterView.as_view(), name='narrators'), # Reference paths path('references/', BookDetailView.as_view(), name='reference-detail'),