Hotfix for subjectstudent serializer

This commit is contained in:
keannu125 2023-04-21 23:45:13 +08:00
parent 5182dfa8da
commit b5d2ad3cac

View file

@ -6,7 +6,7 @@ from students.models import Student
class SubjectSerializer(serializers.HyperlinkedModelSerializer): class SubjectSerializer(serializers.HyperlinkedModelSerializer):
students = serializers.SlugRelatedField( students = serializers.SlugRelatedField(
queryset=Student.objects.all(), many=True, slug_field='full_name', allow_null=True) queryset=Student.objects.all(), many=True, slug_field='last_name', allow_null=True)
class Meta: class Meta:
model = Subject model = Subject