You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
336 B

from rest_framework import serializers
from .models import Student # 你需要根据你的模型导入相应的类
class StudentSerializer(serializers.ModelSerializer):
class Meta:
model = Student
fields = ['name', 'student_id', 'score', 'attendance_count', 'called_count'] # 根据你的模型字段进行调整