У меня есть приложение Сообщество с полем подписчика, связанным с приложением учетных записей, но в ответе он возвращает счет вместо использования сериализатора учетной записи
CommunitySerializer:
class CommunitySerializer(serializers.ModelSerializer):
class Meta:
model = Community
fields = ('name', 'about', 'subscribers', 'moderators')
AccountsSerializer:
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('username',)
Возврат:
{
"name": "pcmasterrace",
"about": "Welcome to the official subreddit of the PC Master Race. In this subreddit, we celebrate and promote the ultimate gaming and working platform. Ascend to a level that respects your eyes, your wallet, your mind, and your heart. Ascend to... the PC Master Race.",
"community_rules": [
{
"rule": "Rule 1 - Off Topic",
"description": "DOnt fuck"
},
{
"rule": "Rule 2 - No tech support",
"description": "community_rulescommunity_rulescommunity_rulescommunity_rulescommunity_rules"
}
],
"subscribers": [
1
],
"moderators": [
1
]
}