我正在尝试实现嵌套的序列化器。
Serializers.py
class BranchSerializer(serializers.ModelSerializer):
class Meta:
model = Branch
fields = '__all__'
class StudentSerializer(serializers.ModelSerializer):
class Meta:
model = Student
fields = '__all__'
重写studentserializers中的分支并导入分支详细信息。
1条答案
按热度按时间jjjwad0x1#