Пример
#models.py
class User(models.Model):
username = models.CharField(max_length=50)
class Member(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
project = models.ForeignKey('currentApp.Project', on_delete=models.CASCADE)
some_dop_info = models.TextField()
class Project(models.Model):
title = models.CharField(max_length=250)
members = models.ManyToManyField(User, through=Member)
#serializers.py
class MemberSerializer(serializers.ModelSerializer):
class Meta:
model = Member
fields = (
'id',
'some_dop_info',
)
class ProjectSerializer(serializers.ModelSerializer):
members = MemberSerializer(many=True, read_only=True)
class Meta:
model = Project
fields = (
"title",
"members",
)
Вопрос: Как получить данные из промежуточной модели Member а именно поле some_dop_info?
Пока бпльше часа гугления ни к чему не привели?