|
|
|
@ -164,11 +164,12 @@ class HadisCategorySelectSerializer(serializers.ModelSerializer): |
|
|
|
has_hadis = serializers.SerializerMethodField() |
|
|
|
hadis_count= serializers.SerializerMethodField() |
|
|
|
title = LocalizedField() |
|
|
|
description =LocalizedField() |
|
|
|
|
|
|
|
class Meta: |
|
|
|
model = HadisCategory |
|
|
|
fields = ['id', 'title', 'source_type','slug', 'sect_id', |
|
|
|
'sect_type','children_count','has_hadis','hadis_count'] |
|
|
|
'sect_type','description','children_count','has_hadis','hadis_count'] |
|
|
|
|
|
|
|
def get_has_hadis(self, obj): |
|
|
|
"""Check if category can have hadis (no active children) and has hadis""" |
|
|
|
@ -200,12 +201,13 @@ class HadisCategorySelectSourceSerializer(serializers.ModelSerializer): |
|
|
|
has_hadis = serializers.SerializerMethodField() |
|
|
|
hadis_count = serializers.SerializerMethodField() |
|
|
|
title = LocalizedField() |
|
|
|
description = LocalizedField() |
|
|
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
model = HadisCategory |
|
|
|
fields = ['id', 'title', 'source_type','slug', 'sect_id', |
|
|
|
'sect_type','children_count','has_hadis','hadis_count'] |
|
|
|
'sect_type','description','children_count','has_hadis','hadis_count'] |
|
|
|
|
|
|
|
def get_has_hadis(self, obj): |
|
|
|
"""Check if category can have hadis (no active children) and has hadis""" |
|
|
|
|