Browse Source

category serializers updated.

master
Mohsen Taba 5 months ago
parent
commit
6e45f7dbd0
  1. 6
      apps/hadis/serializers/category.py

6
apps/hadis/serializers/category.py

@ -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"""

Loading…
Cancel
Save