i am getting TypeError: count() takes at least 1 argument (0 given).
it would be great if anybody could figure out where i am doing thing wrong. thank you so much in advance.
class CommentsSerializer(serializers.ModelSerializer):
comment_count = serializers.SerializerMethodField()
class Meta:
model = Comments
fields = [
"id", "title", "name", "subject", "comment_count",
]
def get_comment_count(self, obj):
return obj.subject.count()