|
|
@ -120,7 +120,7 @@ class HadisCategorySelectSerializer(serializers.ModelSerializer): |
|
|
class Meta: |
|
|
class Meta: |
|
|
model = HadisCategory |
|
|
model = HadisCategory |
|
|
fields = ['id', 'title', 'source_type','slug', 'sect_id', |
|
|
fields = ['id', 'title', 'source_type','slug', 'sect_id', |
|
|
'sect_type','description','children_count','has_hadis','hadis_count'] |
|
|
|
|
|
|
|
|
'sect_type','description','children_count','has_hadis','hadis_count', 'share_link', 'xmind_share_link'] |
|
|
|
|
|
|
|
|
def get_has_hadis(self, obj): |
|
|
def get_has_hadis(self, obj): |
|
|
"""Check if category can have hadis (no active children) and has hadis""" |
|
|
"""Check if category can have hadis (no active children) and has hadis""" |
|
|
@ -167,7 +167,7 @@ class HadisCategorySelectSourceSerializer(serializers.ModelSerializer): |
|
|
class Meta: |
|
|
class Meta: |
|
|
model = HadisCategory |
|
|
model = HadisCategory |
|
|
fields = ['id', 'title', 'source_type','slug', 'sect_id', |
|
|
fields = ['id', 'title', 'source_type','slug', 'sect_id', |
|
|
'sect_type','description','children_count','has_hadis','hadis_count'] |
|
|
|
|
|
|
|
|
'sect_type','description','children_count','has_hadis','hadis_count', 'share_link', 'xmind_share_link'] |
|
|
|
|
|
|
|
|
def get_has_hadis(self, obj): |
|
|
def get_has_hadis(self, obj): |
|
|
"""Check if category can have hadis (no active children) and has hadis""" |
|
|
"""Check if category can have hadis (no active children) and has hadis""" |
|
|
@ -209,7 +209,7 @@ class CategorySerializer(serializers.ModelSerializer): |
|
|
model = HadisCategory |
|
|
model = HadisCategory |
|
|
fields = ['id', 'title', 'sect_id', 'sect_type','source_type', |
|
|
fields = ['id', 'title', 'sect_id', 'sect_type','source_type', |
|
|
'description','slug', |
|
|
'description','slug', |
|
|
'children_count','has_hadis','hadis_count'] |
|
|
|
|
|
|
|
|
'children_count','has_hadis','hadis_count', 'share_link', 'xmind_share_link'] |
|
|
|
|
|
|
|
|
def get_children_count(self, obj): |
|
|
def get_children_count(self, obj): |
|
|
# """Get count of active children categories that have children or hadis""" |
|
|
# """Get count of active children categories that have children or hadis""" |
|
|
|