SyntaxFix
Write A Post
Hire A Developer
Questions
this worked fine for me:
class ItemSerializer(serializers.ModelSerializer): category_name = serializers.ReadOnlyField(source='category.name') class Meta: model = Item fields = "__all__"