Browse Source

merged with recent changes

master
Mohsen Taba 1 week ago
parent
commit
315fc26cad
  1. 492
      apps/hadis/HADIS_SYNC_SAMPLE.md
  2. 689
      apps/hadis/hadis_sample.json
  3. 4
      apps/hadis/serializers/category.py
  4. 6
      apps/hadis/serializers/hadis.py
  5. 2572
      apps/hadis/views/hadis.py

492
apps/hadis/HADIS_SYNC_SAMPLE.md

@ -0,0 +1,492 @@
# نمونه کامل خروجی یک آبجکت حدیث در اندپوینت سینک (`/api/hadis/sync/hadis/`)
این سند ساختار دقیق، واقعی و تودرتوی **فقط یک رکورد حدیث** (حدیث شماره ۱) را نشان می‌دهد که مستقیماً از دیتابیس فعلی و از طریق سریالایزر `HadisSyncSerializer` استخراج شده است.
---
## 📊 مشخصات این آبجکت:
- **تعداد خطوط JSON برای یک حدیث:** ۶۸۹ خط!
- **حجم خالص متنی برای یک حدیث:** حدود **۳۲ کیلوبایت**
- **حجم کل برای ۱۰۵۳ حدیث:** حدود **۳۳ مگابایت** (به دلیل تکرار داده‌های تودرتو)
---
## 🔍 نقاط بحرانی تکرار و تودرتو بودن (Redundancy & Bloat):
1. **تکرار تفاسیر دسته‌بندی در هر حدیث (`interpretations`):**
- تفاسیر به دسته‌بندی تعلق دارند، اما در خروجی **داخل تک‌تک احادیث آن دسته تکرار می‌شوند**. متون تفاسیر شامل کدهای طولانی HTML عربی و روسی هستند.
2. **تکرار مشخصات راویان و لایه‌ها (`transmitters`):**
- برای هر راوی در زنجیره سند (مثلاً ۱۰ راوی)، آبجکت‌های کامل `reliability` و `layer_name` و `layer_description` به همراه لیستی از `uncertain_transmitters` تکرار می‌شوند.
3. **تکرار اطلاعات کتاب‌ها و رفرنس‌ها در تصحیحات (`corrections -> references`):**
- داخل هر تصحیح، آبجکت‌های رفرنس، تصاویر، مشخصات چاپ (`edition_info`) و لینک‌ها به صورت تودرتو دوباره تکرار شده‌اند.
4. **ارجاع به خودِ حدیث در بخش تصحیحات (`hadis_info`):**
- داخل آرایه تصحیحاتِ همین حدیث، فیلد `hadis_info` دوباره `id` و `slug` خودِ همین حدیث را تکرار می‌کند!
---
## 📄 ساختار کامل JSON (نمونه واقعی استخراج‌شده از دیتابیس):
```json
{
"id": 1891,
"number": 1,
"slug": "the-merit-of-seeking-knowledge",
"category_id": 1036,
"category_slug": "reflections",
"title": "The Merit of Seeking Knowledge",
"title_narrator": "Jabir bin Abdullah",
"text": "اتَّقِ اللَّهَ حَيْثُمَا كُنْتَ، وَأَتْبِعِ السَّيِّئَةَ الْحَسَنَةَ تَمْحُهَا.",
"translation": [
{
"title": "Передается от Пророка (мир ему): Правда ведет к благочестию. Это путь праведных.",
"language_code": "ru"
},
{
"title": "The best among you are those who have the best manners and character.",
"language_code": "en"
}
],
"detail": {
"address": [
"Sahih al-Bukhari",
"Book of Revelation",
"Chapter 1: How Revelation Began"
],
"address_details": [],
"hadis_status": {
"id": 133,
"title": "Authentic / Accepted",
"description": "A Sahih (Authentic) Hadith represents the highest level of reliability. It possesses a continuous chain of narrators (Isnad) made up of upright (Adl) and retentive (Dabit) transmitters, free from any hidden defects (Illah) or irregularities (Shudhudh). It is universally accepted for deriving Islamic laws.",
"color": "green",
"main_color_code": "#1DAC43"
},
"status_text": null,
"share_link": "https://dovodi.newhorizonco.uk/arguments/hadith/hadis-ru-1-7c2df773",
"links": {
"Dorar": "https://dorar.net/hadith/1804",
"Al-Islam": "https://www.al-islam.org/6596",
"IslamWeb": "https://www.islamweb.net/ar/fatwa/6463",
"Sunnah.com": "https://sunnah.com/bukhari/3147",
"IslamicFinder": "https://www.islamicfinder.org/1779"
},
"tags": [
{
"id": 510,
"title": "Хадж"
},
{
"id": 516,
"title": "Доверие"
},
{
"id": 561,
"title": "Kindness"
},
{
"id": 565,
"title": "Hellfire (Jahannam)"
},
{
"id": 567,
"title": "Marriage (Nikah)"
}
],
"references": [
{
"id": 2538,
"title": "Man La Yahduruhu al-Faqih",
"authors": [
{
"id": 9,
"name": "sheykh hamid"
}
],
"description": [
{
"title": "For him who is not in the presence of a jurisprudent - Shia collection.",
"language_code": "en"
},
{
"title": "توضیحات درباره من لا یحضره الفقیه",
"language_code": "fa"
}
],
"share_link": "https://dovodi.newhorizonco.uk/arguments/sources/man-la-yahduruhu-al-faqih"
}
],
"reference_images": [
{
"id": 2541,
"thumbnail": "https://dovodi.newhorizonco.uk/media/hadis/reference_images/1891_ref1.png",
"priority": 1
},
{
"id": 2542,
"thumbnail": "https://dovodi.newhorizonco.uk/media/hadis/reference_images/1891_ref2.png",
"priority": 2
},
{
"id": 2543,
"thumbnail": "https://dovodi.newhorizonco.uk/media/hadis/reference_images/1891_ref3.png",
"priority": 3
},
{
"id": 2544,
"thumbnail": "https://dovodi.newhorizonco.uk/media/hadis/reference_images/1891_ref4.png",
"priority": 4
}
]
},
"narrators": {
"description": "Focuses on the relationship between the Creator and the creation.",
"transmitters": [
{
"id": 850,
"name": "Ali ibn Yaqtin",
"slug": "ali-ibn-yaqtin",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 14,
"title": "Reliable",
"slug": "reliable-1-190858903395",
"color": "blue",
"main_color_code": "#5172E1"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": true,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": null,
"death_year_hijri": "40",
"order": 0
},
{
"id": 859,
"name": "Al-Muhaqqiq al-Hilli (Ja'far ibn al-Hasan)",
"slug": "al-muhaqqiq-al-hilli-jafar-ibn-al-hasan",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 17,
"title": "Very Weak",
"slug": "very-weak-1-190858905701",
"color": "red",
"main_color_code": "#D33A3A"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": false,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": null,
"death_year_hijri": "36",
"order": 1
},
{
"id": 867,
"name": "Al-Miqdad ibn al-Aswad",
"slug": "al-miqdad-ibn-al-aswad",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 12,
"title": "Unknown",
"slug": "unknown",
"color": "gray",
"main_color_code": "#374151"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": true,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": null,
"death_year_hijri": "117",
"order": 2
},
{
"id": 1016,
"name": "Muhammad ibn Yahya al-Attar al-Qummi",
"slug": "muhammad-ibn-yahya-al-attar-al-qummi",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 58,
"title": "сподвижник",
"slug": "сподвижник",
"color": "gray",
"main_color_code": "#374151"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": false,
"is_uncertain": true,
"uncertain_transmitters": [
{
"id": 871,
"name": "Malik al-Ashtar al-Nakha'i",
"slug": "malik-al-ashtar-al-nakhai",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": null,
"death_year_hijri": "161",
"reliability": {
"id": 7,
"title": "Very Reliable",
"slug": "very-reliable",
"color": "green",
"main_color_code": "#1DAC43"
}
},
{
"id": 1016,
"name": "Muhammad ibn Yahya al-Attar al-Qummi",
"slug": "muhammad-ibn-yahya-al-attar-al-qummi",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": "",
"death_year_hijri": "57",
"reliability": {
"id": 58,
"title": "сподвижник",
"slug": "сподвижник",
"color": "gray",
"main_color_code": "#374151"
}
}
],
"birth_year_hijri": "",
"death_year_hijri": "57",
"order": 3
},
{
"id": 886,
"name": "Ali ibn Mahziyar al-Ahwazi",
"slug": "ali-ibn-mahziyar-al-ahwazi",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 16,
"title": "Weak",
"slug": "weak-1-190858898727",
"color": "orange",
"main_color_code": "#E67E22"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": false,
"is_uncertain": true,
"uncertain_transmitters": [
{
"id": 884,
"name": "Abd Allah ibn Mughirah",
"slug": "abd-allah-ibn-mughirah",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": null,
"death_year_hijri": "385",
"reliability": {
"id": 13,
"title": "Very Reliable",
"slug": "very-reliable-1-190858893632",
"color": "green",
"main_color_code": "#1DAC43"
}
},
{
"id": 886,
"name": "Ali ibn Mahziyar al-Ahwazi",
"slug": "ali-ibn-mahziyar-al-ahwazi",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": null,
"death_year_hijri": "405",
"reliability": {
"id": 16,
"title": "Weak",
"slug": "weak-1-190858898727",
"color": "orange",
"main_color_code": "#E67E22"
}
}
],
"birth_year_hijri": null,
"death_year_hijri": "405",
"order": 4
},
{
"id": 1033,
"name": "Muhammad Hasan al-Shirazi",
"slug": "muhammad-hasan-al-shirazi",
"known_as": "زراره",
"nickname": "زراره شیبانی",
"reliability": {
"id": 7,
"title": "Very Reliable",
"slug": "very-reliable",
"color": "green",
"main_color_code": "#1DAC43"
},
"layer_id": 5700,
"narrator_layer_id": 5700,
"layer_level": 2,
"layer_name": "Prominent Hadith Compilers",
"layer_description": "Leading scholars, authors, and systematizers of prophetic narrations.",
"is_gap": false,
"is_uncertain": true,
"uncertain_transmitters": [
{
"id": 1033,
"name": "Muhammad Hasan al-Shirazi",
"slug": "muhammad-hasan-al-shirazi",
"known_as": "زراره",
"nickname": "زراره شیبانی",
"birth_year_hijri": "80",
"death_year_hijri": "150",
"reliability": {
"id": 7,
"title": "Very Reliable",
"slug": "very-reliable",
"color": "green",
"main_color_code": "#1DAC43"
}
},
{
"id": 853,
"name": "Muhammad ibn Ya'qub al-Kulayni",
"slug": "muhammad-ibn-yaqub-al-kulayni",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": null,
"death_year_hijri": "35",
"reliability": {
"id": 15,
"title": "Acceptable",
"slug": "acceptable-1-190858896271",
"color": "yellow",
"main_color_code": "#EDC130"
}
}
],
"birth_year_hijri": "80",
"death_year_hijri": "150",
"order": 5
}
]
},
"explanations": [
{
"title": "Vocabulary & Linguistic Analysis",
"detail": "The term 'Niyyah' (Intention) is pivotal in Islamic lexicon, derived from the root 'nawa'..."
},
{
"title": "Context of Revelation (Asbab al-Wurud)",
"detail": "This tradition is famously known as the 'Hadith of the Migrant to Umm Qais'..."
}
],
"corrections": [
{
"id": 26,
"title": "Scholar Note #4",
"slug": "scholar-note-4",
"narrator": "زُرارَةُ بْنُ أَعْيَنَ الشَّيبانِيّ",
"description": "بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ\nالْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ...",
"translation": "Revised text segment for correction 4...",
"share_link": "https://dovodi.newhorizonco.uk/arguments/hadith/hadis-ru-1-7c2df773/corrections/scholar-note-4",
"hadis_info": {
"id": 1891,
"number": 1,
"slug": "the-merit-of-seeking-knowledge"
},
"address": [
"Tirmidhi, Abu Isa Muhammad ibn Isa (died 279 AH), \"Jami' al-Sahih (Sunan At-Tirmidhi)\"..."
],
"images": [],
"references": [
{
"id": 4034,
"book": null,
"author": null,
"edition": null,
"volume_info": null,
"hadith_number": null,
"volume": null,
"pages": null,
"address": "Tirmidhi, Abu Isa Muhammad ibn Isa...",
"url": null,
"open_book_url": null,
"citation_summary": "",
"images": [],
"images_count": 0,
"book_title": null,
"book_authors": [],
"edition_info": null
}
],
"links": [
{
"link": "google.com",
"title": "Первая ссылка"
}
]
}
],
"interpretations": [
{
"id": 12,
"title": null,
"slug": "cat-l3-25-7f5bcb",
"narrator": "زُرارَةُ بْنُ أَعْيَنَ الشَّيبانِيّ",
"text": "<p dir=\"rtl\">الْمَسْأَلَةُ الثَّامِنَةُ : قَوْلُهُ : { أَهْلَ الْبَيْتِ }...</p>",
"translation": "<p>Вопрос восьмой: (что означают) слова: Ахл аль-бейт...</p>",
"category_info": {
"id": 1036,
"slug": "reflections",
"title": "Reflections"
},
"address": [
"Tirmidhi, Abu Isa Muhammad ibn Isa..."
],
"images": [],
"links": [],
"references": [
{
"id": 76,
"book_title": "last book",
"book_authors": [
{
"id": 9,
"name": "sheykh hamid"
}
],
"edition_info": null,
"volume_info": null,
"hadith_number": null,
"volume": "",
"pages": "",
"address": "Tirmidhi, Abu Isa Muhammad ibn Isa...",
"url": null,
"images": []
}
]
}
]
}
```

689
apps/hadis/hadis_sample.json

@ -0,0 +1,689 @@
{
"id": 1891,
"number": 1,
"slug": "the-merit-of-seeking-knowledge",
"category_id": 1036,
"category_slug": "reflections",
"title": "The Merit of Seeking Knowledge",
"title_narrator": "Jabir bin Abdullah",
"text": "اتَّقِ اللَّهَ حَيْثُمَا كُنْتَ، وَأَتْبِعِ السَّيِّئَةَ الْحَسَنَةَ تَمْحُهَا.",
"translation": [
{
"title": "Передается от Пророка (мир ему): Правда ведет к благочестию. Это путь праведных.",
"language_code": "ru"
},
{
"title": "The best among you are those who have the best manners and character.",
"language_code": "en"
}
],
"detail": {
"address": [
"Sahih al-Bukhari",
"Book of Revelation",
"Chapter 1: How Revelation Began"
],
"address_details": [],
"hadis_status": {
"id": 133,
"title": "Authentic / Accepted",
"description": "A Sahih (Authentic) Hadith represents the highest level of reliability. It possesses a continuous chain of narrators (Isnad) made up of upright (Adl) and retentive (Dabit) transmitters, free from any hidden defects (Illah) or irregularities (Shudhudh). It is universally accepted for deriving Islamic laws.",
"color": "green",
"main_color_code": "#1DAC43"
},
"status_text": null,
"share_link": "https://dovodi.newhorizonco.uk/arguments/hadith/hadis-ru-1-7c2df773",
"links": {
"Dorar": "https://dorar.net/hadith/1804",
"Al-Islam": "https://www.al-islam.org/6596",
"IslamWeb": "https://www.islamweb.net/ar/fatwa/6463",
"Sunnah.com": "https://sunnah.com/bukhari/3147",
"IslamicFinder": "https://www.islamicfinder.org/1779"
},
"tags": [
{
"id": 510,
"title": "Хадж"
},
{
"id": 516,
"title": "Доверие"
},
{
"id": 561,
"title": "Kindness"
},
{
"id": 565,
"title": "Hellfire (Jahannam)"
},
{
"id": 567,
"title": "Marriage (Nikah)"
}
],
"references": [
{
"id": 2538,
"title": "Man La Yahduruhu al-Faqih",
"authors": [
{
"id": 9,
"name": "sheykh hamid"
}
],
"description": [
{
"title": "For him who is not in the presence of a jurisprudent - Shia collection.",
"language_code": "en"
},
{
"title": "توضیحات درباره من لا یحضره الفقیه",
"language_code": "fa"
}
],
"share_link": "https://dovodi.newhorizonco.uk/arguments/sources/man-la-yahduruhu-al-faqih"
}
],
"reference_images": [
{
"id": 2541,
"thumbnail": "https://testserver/media/hadis/reference_images/1891_ref1.png",
"priority": 1
},
{
"id": 2542,
"thumbnail": "https://testserver/media/hadis/reference_images/1891_ref2.png",
"priority": 2
},
{
"id": 2543,
"thumbnail": "https://testserver/media/hadis/reference_images/1891_ref3.png",
"priority": 3
},
{
"id": 2544,
"thumbnail": "https://testserver/media/hadis/reference_images/1891_ref4.png",
"priority": 4
}
]
},
"narrators": {
"description": "Focuses on the relationship between the Creator and the creation.",
"transmitters": [
{
"id": 850,
"name": "Ali ibn Yaqtin",
"slug": "ali-ibn-yaqtin",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 14,
"title": "Reliable",
"slug": "reliable-1-190858903395",
"color": "blue",
"main_color_code": "#5172E1"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": true,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": null,
"death_year_hijri": "40",
"order": 0
},
{
"id": 859,
"name": "Al-Muhaqqiq al-Hilli (Ja'far ibn al-Hasan)",
"slug": "al-muhaqqiq-al-hilli-jafar-ibn-al-hasan",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 17,
"title": "Very Weak",
"slug": "very-weak-1-190858905701",
"color": "red",
"main_color_code": "#D33A3A"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": false,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": null,
"death_year_hijri": "36",
"order": 1
},
{
"id": 867,
"name": "Al-Miqdad ibn al-Aswad",
"slug": "al-miqdad-ibn-al-aswad",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 12,
"title": "Unknown",
"slug": "unknown",
"color": "gray",
"main_color_code": "#374151"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": true,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": null,
"death_year_hijri": "117",
"order": 2
},
{
"id": 1016,
"name": "Muhammad ibn Yahya al-Attar al-Qummi",
"slug": "muhammad-ibn-yahya-al-attar-al-qummi",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 58,
"title": "сподвижник",
"slug": "сподвижник",
"color": "gray",
"main_color_code": "#374151"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": false,
"is_uncertain": true,
"uncertain_transmitters": [
{
"id": 871,
"name": "Malik al-Ashtar al-Nakha'i",
"slug": "malik-al-ashtar-al-nakhai",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": null,
"death_year_hijri": "161",
"reliability": {
"id": 7,
"title": "Very Reliable",
"slug": "very-reliable",
"color": "green",
"main_color_code": "#1DAC43"
}
},
{
"id": 1016,
"name": "Muhammad ibn Yahya al-Attar al-Qummi",
"slug": "muhammad-ibn-yahya-al-attar-al-qummi",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": "",
"death_year_hijri": "57",
"reliability": {
"id": 58,
"title": "сподвижник",
"slug": "сподвижник",
"color": "gray",
"main_color_code": "#374151"
}
}
],
"birth_year_hijri": "",
"death_year_hijri": "57",
"order": 3
},
{
"id": 886,
"name": "Ali ibn Mahziyar al-Ahwazi",
"slug": "ali-ibn-mahziyar-al-ahwazi",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 16,
"title": "Weak",
"slug": "weak-1-190858898727",
"color": "orange",
"main_color_code": "#E67E22"
},
"layer_id": 5699,
"narrator_layer_id": 5699,
"layer_level": 1,
"layer_name": "Primary Chain & Early Narrators",
"layer_description": "Early generation transmitters, companions, and direct students.",
"is_gap": false,
"is_uncertain": true,
"uncertain_transmitters": [
{
"id": 884,
"name": "Abd Allah ibn Mughirah",
"slug": "abd-allah-ibn-mughirah",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": null,
"death_year_hijri": "385",
"reliability": {
"id": 13,
"title": "Very Reliable",
"slug": "very-reliable-1-190858893632",
"color": "green",
"main_color_code": "#1DAC43"
}
},
{
"id": 886,
"name": "Ali ibn Mahziyar al-Ahwazi",
"slug": "ali-ibn-mahziyar-al-ahwazi",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": null,
"death_year_hijri": "405",
"reliability": {
"id": 16,
"title": "Weak",
"slug": "weak-1-190858898727",
"color": "orange",
"main_color_code": "#E67E22"
}
}
],
"birth_year_hijri": null,
"death_year_hijri": "405",
"order": 4
},
{
"id": 1033,
"name": "Muhammad Hasan al-Shirazi",
"slug": "muhammad-hasan-al-shirazi",
"known_as": "زراره",
"nickname": "زراره شیبانی",
"reliability": {
"id": 7,
"title": "Very Reliable",
"slug": "very-reliable",
"color": "green",
"main_color_code": "#1DAC43"
},
"layer_id": 5700,
"narrator_layer_id": 5700,
"layer_level": 2,
"layer_name": "Prominent Hadith Compilers",
"layer_description": "Leading scholars, authors, and systematizers of prophetic narrations.",
"is_gap": false,
"is_uncertain": true,
"uncertain_transmitters": [
{
"id": 1033,
"name": "Muhammad Hasan al-Shirazi",
"slug": "muhammad-hasan-al-shirazi",
"known_as": "زراره",
"nickname": "زراره شیبانی",
"birth_year_hijri": "80",
"death_year_hijri": "150",
"reliability": {
"id": 7,
"title": "Very Reliable",
"slug": "very-reliable",
"color": "green",
"main_color_code": "#1DAC43"
}
},
{
"id": 853,
"name": "Muhammad ibn Ya'qub al-Kulayni",
"slug": "muhammad-ibn-yaqub-al-kulayni",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"birth_year_hijri": null,
"death_year_hijri": "35",
"reliability": {
"id": 15,
"title": "Acceptable",
"slug": "acceptable-1-190858896271",
"color": "yellow",
"main_color_code": "#EDC130"
}
}
],
"birth_year_hijri": "80",
"death_year_hijri": "150",
"order": 5
},
{
"id": 1016,
"name": "Muhammad ibn Yahya al-Attar al-Qummi",
"slug": "muhammad-ibn-yahya-al-attar-al-qummi",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 58,
"title": "сподвижник",
"slug": "сподвижник",
"color": "gray",
"main_color_code": "#374151"
},
"layer_id": 5700,
"narrator_layer_id": 5700,
"layer_level": 2,
"layer_name": "Prominent Hadith Compilers",
"layer_description": "Leading scholars, authors, and systematizers of prophetic narrations.",
"is_gap": true,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": "",
"death_year_hijri": "57",
"order": 6
},
{
"id": 856,
"name": "Ali ibn al-Husayn al-Sharif al-Murtada",
"slug": "ali-ibn-al-husayn-al-sharif-al-murtada",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 12,
"title": "Unknown",
"slug": "unknown",
"color": "gray",
"main_color_code": "#374151"
},
"layer_id": 5700,
"narrator_layer_id": 5700,
"layer_level": 2,
"layer_name": "Prominent Hadith Compilers",
"layer_description": "Leading scholars, authors, and systematizers of prophetic narrations.",
"is_gap": false,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": null,
"death_year_hijri": "37",
"order": 7
},
{
"id": 89,
"name": "Al-Fudayl ibn Yasar",
"slug": "al-fudayl-ibn-yasar",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 9,
"title": "Acceptable",
"slug": "acceptable",
"color": "yellow",
"main_color_code": "#EDC130"
},
"layer_id": 5700,
"narrator_layer_id": 5700,
"layer_level": 2,
"layer_name": "Prominent Hadith Compilers",
"layer_description": "Leading scholars, authors, and systematizers of prophetic narrations.",
"is_gap": false,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": null,
"death_year_hijri": "250",
"order": 8
},
{
"id": 863,
"name": "Al-Hurr al-Amili (Muhammad ibn al-Hasan)",
"slug": "al-hurr-al-amili-muhammad-ibn-al-hasan",
"known_as": "ibn Hilal",
"nickname": "Al-Basri",
"reliability": {
"id": 10,
"title": "Weak",
"slug": "weak",
"color": "orange",
"main_color_code": "#E67E22"
},
"layer_id": 5700,
"narrator_layer_id": 5700,
"layer_level": 2,
"layer_name": "Prominent Hadith Compilers",
"layer_description": "Leading scholars, authors, and systematizers of prophetic narrations.",
"is_gap": true,
"is_uncertain": false,
"uncertain_transmitters": [],
"birth_year_hijri": null,
"death_year_hijri": "94",
"order": 9
}
]
},
"explanations": [
{
"title": "Vocabulary & Linguistic Analysis",
"detail": "The term 'Niyyah' (Intention) is pivotal in Islamic lexicon, derived from the root 'nawa', meaning to aim, direct, or purpose oneself towards a specific destination. In the terminology of the jurists (Fuqaha), it serves a dual function: firstly, to distinguish acts of worship (Ibadah) from mundane customary habits (Adah)—such as distinguishing the act of washing oneself for cooling off from the act of Ghusl (ritual purification). Secondly, it distinguishes different ranks of worship from one another, such as separating a noon prayer that is obligatory (Fard) from one that is voluntary (Sunnah). Philosophically, scholars like Al-Ghazali have elaborated that Niyyah is the 'spirit' of the action, while the physical movement is merely the 'body'; a body without a spirit is lifeless, just as an action without sincere intention holds no weight in the Divine Court."
},
{
"title": "Context of Revelation (Asbab al-Wurud)",
"detail": "This tradition is famously known as the 'Hadith of the Migrant to Umm Qais'. It was delivered by the Prophet (PBUH) from the pulpit in Medina to address a subtle but critical issue within the community. Reports indicate that a man had migrated from Mecca to Medina not solely for the sake of Allah and His Messenger, but because a woman named Umm Qais had refused to marry him unless he undertook the migration. While his physical journey was identical to the other companions who sacrificed their homes for faith, his internal compass was directed towards a worldly gain. The Prophet (PBUH) used this specific incident to establish a universal maxim: that the validity and reward of any deed are inextricably bound to the hidden motive behind it, warning that one who targets the world will attain only that, with no share in the Hereafter."
}
],
"corrections": [
{
"id": 26,
"title": "Scholar Note #4",
"slug": "scholar-note-4",
"narrator": "زُرارَةُ بْنُ أَعْيَنَ الشَّيبانِيّ",
"description": "بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ\nالْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ، وَالصَّلَاةُ وَالسَّلَامُ عَلَى سَيِّدِنَا مُحَمَّدٍ وَآلِهِ الطَّاهِرِينَ.\nاللَّهُمَّ زَيِّنَّا بِالْعِلْمِ وَالْحِلْمِ، وَاجْعَلْ أَلْسِنَتَنَا ذَاكِرَةً لَكَ وَقُلُوبَنَا خَاشِعَةً لَكَ.\nوَارْزُقْنَا صِدْقَ الْقَوْلِ وَحُسْنَ الْعَمَلِ، إِنَّكَ أَنْتَ الْوَهَّابُ الْكَرِيمُ.",
"translation": "Revised text segment for correction 4...",
"share_link": "https://dovodi.newhorizonco.uk/arguments/hadith/hadis-ru-1-7c2df773/corrections/scholar-note-4",
"hadis_info": {
"id": 1891,
"number": 1,
"slug": "the-merit-of-seeking-knowledge"
},
"address": [
"Tirmidhi, Abu Isa Muhammad ibn Isa (died 279 AH), \"Jami' al-Sahih (Sunan At-Tirmidhi)\", book: virtues, chapter: virtues of Ali ibn Abu Talib, volume 5, page 633, hadith 3713, research: Ahmad Muhammad Shakir and others, Mustafa al-Babi al-Halabi Publishing House, Egypt, 2nd edition, 1395 - 1975, in five volumes."
],
"images": [],
"references": [
{
"id": 4034,
"book": null,
"author": null,
"edition": null,
"volume_info": null,
"hadith_number": null,
"volume": null,
"pages": null,
"address": "Tirmidhi, Abu Isa Muhammad ibn Isa (died 279 AH), \"Jami' al-Sahih (Sunan At-Tirmidhi)\", book: virtues, chapter: virtues of Ali ibn Abu Talib, volume 5, page 633, hadith 3713, research: Ahmad Muhammad Shakir and others, Mustafa al-Babi al-Halabi Publishing House, Egypt, 2nd edition, 1395 - 1975, in five volumes.",
"url": null,
"open_book_url": null,
"citation_summary": "",
"images": [],
"images_count": 0,
"book_title": null,
"book_authors": [],
"edition_info": null
}
],
"links": [
{
"link": "google.com",
"title": "Первая ссылка Первая ссылка ссылкассы..."
},
{
"link": "google.com",
"title": "Первая ссылка."
},
{
"link": "google.com",
"title": "Первая ссылка."
}
]
},
{
"id": 25,
"title": "Alternative Translation #3",
"slug": "alternative-translation-3",
"narrator": "زُرارَةُ بْنُ أَعْيَنَ الشَّيبانِيّ",
"description": "بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ\nالْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ، وَالصَّلَاةُ وَالسَّلَامُ عَلَى سَيِّدِنَا مُحَمَّدٍ وَآلِهِ الطَّاهِرِينَ.\nاللَّهُمَّ زَيِّنَّا بِالْعِلْمِ وَالْحِلْمِ، وَاجْعَلْ أَلْسِنَتَنَا ذَاكِرَةً لَكَ وَقُلُوبَنَا خَاشِعَةً لَكَ.\nوَارْزُقْنَا صِدْقَ الْقَوْلِ وَحُسْنَ الْعَمَلِ، إِنَّكَ أَنْتَ الْوَهَّابُ الْكَرِيمُ.",
"translation": "Revised text segment for correction 3...",
"share_link": "https://dovodi.newhorizonco.uk/arguments/hadith/hadis-ru-1-7c2df773/corrections/alternative-translation-3",
"hadis_info": {
"id": 1891,
"number": 1,
"slug": "the-merit-of-seeking-knowledge"
},
"address": [
"Tirmidhi, Abu Isa Muhammad ibn Isa (died 279 AH), \"Jami' al-Sahih (Sunan At-Tirmidhi)\", book: virtues, chapter: virtues of Ali ibn Abu Talib, volume 5, page 633, hadith 3713, research: Ahmad Muhammad Shakir and others, Mustafa al-Babi al-Halabi Publishing House, Egypt, 2nd edition, 1395 - 1975, in five volumes."
],
"images": [],
"references": [
{
"id": 4035,
"book": null,
"author": null,
"edition": null,
"volume_info": null,
"hadith_number": null,
"volume": null,
"pages": null,
"address": "Tirmidhi, Abu Isa Muhammad ibn Isa (died 279 AH), \"Jami' al-Sahih (Sunan At-Tirmidhi)\", book: virtues, chapter: virtues of Ali ibn Abu Talib, volume 5, page 633, hadith 3713, research: Ahmad Muhammad Shakir and others, Mustafa al-Babi al-Halabi Publishing House, Egypt, 2nd edition, 1395 - 1975, in five volumes.",
"url": null,
"open_book_url": null,
"citation_summary": "",
"images": [],
"images_count": 0,
"book_title": null,
"book_authors": [],
"edition_info": null
}
],
"links": [
{
"link": "google.com",
"title": "Первая ссылка Первая ссылка ссылкассы..."
},
{
"link": "google.com",
"title": "Первая ссылка."
},
{
"link": "google.com",
"title": "Первая ссылка."
}
]
},
{
"id": 24,
"title": "Context Clarification #2",
"slug": "context-clarification-2",
"narrator": "زُرارَةُ بْنُ أَعْيَنَ الشَّيبانِيّ",
"description": "بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ\r\nالْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ، وَالصَّلَاةُ وَالسَّلَامُ عَلَى سَيِّدِنَا مُحَمَّدٍ وَآلِهِ الطَّاهِرِينَ.\r\nاللَّهُمَّ زَيِّنَّا بِالْعِلْمِ وَالْحِلْمِ، وَاجْعَلْ أَلْسِنَتَنَا ذَاكِرَةً لَكَ وَقُلُوبَنَا خَاشِعَةً لَكَ.\r\nوَارْزُقْنَا صِدْقَ الْقَوْلِ وَحُسْنَ الْعَمَلِ، إِنَّكَ أَنْتَ الْوَهَّابُ الْكَرِيمُ.",
"translation": "Revised text segment for correction 2...",
"share_link": "https://dovodi.newhorizonco.uk/arguments/hadith/hadis-ru-1-7c2df773/corrections/context-clarification-2",
"hadis_info": {
"id": 1891,
"number": 1,
"slug": "the-merit-of-seeking-knowledge"
},
"address": [
"Tirmidhi, Abu Isa Muhammad ibn Isa (died 279 AH), \"Jami' al-Sahih (Sunan At-Tirmidhi)\", book: virtues, chapter: virtues of Ali ibn Abu Talib, volume 5, page 633, hadith 3713, research: Ahmad Muhammad Shakir and others, Mustafa al-Babi al-Halabi Publishing House, Egypt, 2nd edition, 1395 - 1975, in five volumes."
],
"images": [
{
"id": 85,
"image": "https://testserver/media/hadis/correction_images/image.png",
"thumbnail": "https://testserver/media/hadis/correction_images/image.png"
}
],
"references": [
{
"id": 4036,
"book": null,
"author": null,
"edition": null,
"volume_info": null,
"hadith_number": null,
"volume": null,
"pages": null,
"address": "Tirmidhi, Abu Isa Muhammad ibn Isa (died 279 AH), \"Jami' al-Sahih (Sunan At-Tirmidhi)\", book: virtues, chapter: virtues of Ali ibn Abu Talib, volume 5, page 633, hadith 3713, research: Ahmad Muhammad Shakir and others, Mustafa al-Babi al-Halabi Publishing House, Egypt, 2nd edition, 1395 - 1975, in five volumes.",
"url": null,
"open_book_url": null,
"citation_summary": "",
"images": [
{
"id": 85,
"image": "https://testserver/media/hadis/correction_images/image.png",
"thumbnail": "https://testserver/media/hadis/correction_images/image.png",
"priority": 0
}
],
"images_count": 1,
"book_title": null,
"book_authors": [],
"edition_info": null
}
],
"links": {}
}
],
"interpretations": [
{
"id": 12,
"title": null,
"slug": "cat-l3-25-7f5bcb",
"narrator": "زُرارَةُ بْنُ أَعْيَنَ الشَّيبانِيّ",
"text": "<p dir=\"rtl\"><span style=\"color: #e65050;\">الْمَسْأَلَةُ الثَّامِنَةُ : قَوْلُهُ : { أَهْلَ الْبَيْتِ }</span></p>\n\n<p dir=\"rtl\">رُوِيَ عَنْ عُمَرَ بْنِ أَبِي سَلَمَةَ أَنَّهُ قَالَ : { لَمَّا نَزَلَتْ هَذِهِ الْآيَةُ عَلَى النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : { إنَّمَا يُرِيدُ اللَّهُ لِيُذْهِبَ عَنْكُمْ الرِّجْسَ أَهْلَ الْبَيْتِ وَيُطَهِّرَكُمْ تَطْهِيرًا } فِي بَيْتِ أُمِّ سَلَمَةَ دَعَا النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ&nbsp;<span style=\"color: #e65050;\">فَاطِمَةَ وَحَسَنًا وَحُسَيْنًا</span>&nbsp;، وَجَعَلَ&nbsp;<span style=\"color: #e65050;\">عَلِيًّا</span>&nbsp;خَلْفَ ظَهْرِهِ ، وَجَلَّلَهُمْ بِكِسَاءٍ ، ثُمَّ قَالَ : اللَّهُمَّ إنَّ هَؤُلَاءِ أَهْلَ بَيْتِي ، فَأَذْهِبْ عَنْهُمْ الرِّجْسَ وَطَهِّرْهُمْ تَطْهِيرًا . قَالَتْ أُمُّ سَلَمَةَ : وَأَنَا مَعَهُمْ يَا نَبِيَّ اللَّهِ . قَالَ : أَنْتِ عَلَى مَكَانِك وَأَنْتِ عَلَى خَيْرٍ } .</p>\n\n<p dir=\"rtl\">وَرَوَى أَنَسُ بْنُ مَالِكٍ { أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ كَانَ يَمُرُّ بِبَابِ فَاطِمَةَ سِتَّةَ أَشْهُرٍ إذَا خَرَجَ إلَى صَلَاةِ الْفَجْرِ يَقُولُ : الصَّلَاةَ يَا أَهْلَ الْبَيْتِ ، إنَّمَا يُرِيدُ اللَّهُ لِيُذْهِبَ عَنْكُمْ الرِّجْسَ أَهْلَ الْبَيْتِ وَيُطَهِّرَكُمْ تَطْهِيرًا } . خَرَّجَ هَذَيْنِ الْحَدِيثَيْنِ التِّرْمِذِيُّ وَغَيْرُهُ .</p>",
"translation": "<p><span style=\"color: #e65050;\">Вопрос восьмой: (что означают) слова: Ахл аль-бейт</span></p>\n\n<p>Передают от Умар ибн Аби Саламе, что когда был ниспослан аят &laquo;Аллах хочет удалить скверну от вас, о Люди дома (Ахл аль-бейт), и очистить вас наилучшим очищением&raquo; (Сура 33, аят 33) в доме Ум Саламы, Посланник Аллаха (с) позвал к себе&nbsp;<span style=\"color: #e65050;\">Фатиму, Хасана и Хусейна</span>, затем накрыл их своей накидкой, а&nbsp;<span style=\"color: #e65050;\">Али</span>&nbsp;был за Пророком, Пророк и его накрыл. После того, как Пророк накрыл их всех накидкой, он изволил сказать следующее: &laquo;О, Аллах, они люди моего дома, очисти же их наилучшим очищением!&raquo;. Ум Салама говорит: &laquo;Я сказала: &laquo;О, Пророк Аллаха! Я тоже с ними?&raquo; Посланник Аллаха изволил сказать: &laquo;Ты оставайся при своем положении, и ты в добре&raquo;.</p>\n\n<p>Передают от Анас Ибн Малика: Поистине посланник Аллах (мир ему и благословение Аллаха!) шесть месяцев проходил мимо&nbsp;<span style=\"color: #e65050;\">двери Фатимы</span>, когда выходил на утреннюю молитву, и говорил: время молитвы, о Ахл аль бейт! \"Аллах хочет удалить скверну от вас, о Люди дома (Ахл аль-бейт), и очистить вас наилучшим очищением\" (Сура 33, аят 33).</p>\n\n<p>Эти два хадиса привели Тирмизи и другие.</p>",
"category_info": {
"id": 1036,
"slug": "reflections",
"title": "Reflections"
},
"address": [
"Tirmidhi, Abu Isa Muhammad ibn Isa (died 279 AH), \"Jami' al-Sahih (Sunan At-Tirmidhi)\", book: virtues, chapter: virtues of Ali ibn Abu Talib, volume 5, page 633, hadith 3713, research: Ahmad Muhammad Shakir and others, Mustafa al-Babi al-Halabi Publishing House, Egypt, 2nd edition, 1395 - 1975, in five volumes."
],
"images": [],
"links": [
{
"link": "google.com",
"title": "Первая ссылка Первая ссылка ссылкассы..."
},
{
"link": "google.com",
"title": "Первая ссылка."
},
{
"link": "google.com",
"title": "Первая ссылка."
}
],
"references": [
{
"id": 76,
"book_title": "last book",
"book_authors": [
{
"id": 9,
"name": "sheykh hamid"
}
],
"edition_info": null,
"volume_info": null,
"hadith_number": null,
"volume": "",
"pages": "",
"address": "Tirmidhi, Abu Isa Muhammad ibn Isa (died 279 AH), \"Jami' al-Sahih (Sunan At-Tirmidhi)\", book: virtues, chapter: virtues of Ali ibn Abu Talib, volume 5, page 633, hadith 3713, research: Ahmad Muhammad Shakir and others, Mustafa al-Babi al-Halabi Publishing House, Egypt, 2nd edition, 1395 - 1975, in five volumes.",
"url": null,
"images": []
}
]
}
]
}

4
apps/hadis/serializers/category.py

@ -8,14 +8,14 @@ from django.utils.translation import get_language
def _get_localized_item_value(item): def _get_localized_item_value(item):
""" """
Prefer `title`, but fall back to `text` or `name` for older/mis-shaped localized entries.
Prefer `title`, but fall back to `text`, `name`, or `description` for localized entries.
""" """
if not item: if not item:
return None return None
if isinstance(item, str): if isinstance(item, str):
return item return item
if isinstance(item, dict): if isinstance(item, dict):
return item.get("title") or item.get("text") or item.get("name")
return item.get("title") or item.get("text") or item.get("name") or item.get("description")
return str(item) return str(item)
def get_localized_text(json_list, request=None, fallback_lang="en", language_code=None): def get_localized_text(json_list, request=None, fallback_lang="en", language_code=None):

6
apps/hadis/serializers/hadis.py

@ -1318,6 +1318,7 @@ class HadisShortSerializer(serializers.ModelSerializer):
class HadisDetailSerializer(serializers.ModelSerializer): class HadisDetailSerializer(serializers.ModelSerializer):
"""Detailed serializer for Hadis with core information (transmitters and corrections moved to separate endpoints)""" """Detailed serializer for Hadis with core information (transmitters and corrections moved to separate endpoints)"""
hadis_status = HadisStatusSerializer(read_only=True) hadis_status = HadisStatusSerializer(read_only=True)
status_text = LocalizedField(source='hadis_status_text')
tags = HadisTagSerializer(many=True, read_only=True) tags = HadisTagSerializer(many=True, read_only=True)
references = HadisReferenceSerializer( references = HadisReferenceSerializer(
many=True, many=True,
@ -1326,13 +1327,12 @@ class HadisDetailSerializer(serializers.ModelSerializer):
reference_images = SerializerMethodField() reference_images = SerializerMethodField()
address = LocalizedField() address = LocalizedField()
category_slug = serializers.CharField(source='category.slug', read_only=True) category_slug = serializers.CharField(source='category.slug', read_only=True)
# address_details = serializers.SerializerMethodField()
class Meta: class Meta:
model = Hadis model = Hadis
fields = [ fields = [
'id', 'number', 'slug', 'category_id', 'category_slug', 'hadis_status','links','share_link',
'tags','references','reference_images','address'
'id', 'number', 'slug', 'category_id', 'category_slug', 'hadis_status', 'status_text', 'links', 'share_link',
'tags', 'references', 'reference_images', 'address'
] ]
# def get_address_details(self, obj): # def get_address_details(self, obj):

2572
apps/hadis/views/hadis.py
File diff suppressed because it is too large
View File

Loading…
Cancel
Save