add image field

This commit is contained in:
Parsa Nazer
2025-01-28 22:35:13 +03:30
parent 39bd8bdb4d
commit 9041b7c7e2
+1 -1
View File
@@ -40,7 +40,7 @@ class SubCategorySerializer(serializers.ModelSerializer):
parent = serializers.SerializerMethodField()
class Meta:
model = SubCategoryModel
fields = ['id', 'name', 'slug','icon', 'meta_title', 'meta_description', 'product_count', 'show', 'parent']
fields = ['id', 'name', 'slug','icon', 'meta_title', 'meta_description', 'product_count', 'show', 'parent', 'image']
def get_product_count(self, obj):
return obj.products.count()
def get_parent(self, obj):