classroom.serializers.courses.CourseRoleRequestSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[소스]¶Bases: rest_framework.serializers.Serializer
classroom.serializers.courses.CourseRoleSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[소스]¶Bases: rest_framework.serializers.ModelSerializer
Meta[소스]¶Bases: object
extra_kwargs = {'type': {'required': False}}¶fields = ['id', 'name', 'email', 'joinedAt']¶model¶alias of classroom.models.courses.CourseRole
create(validated_data)[소스]¶We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:
return ExampleModel.objects.create(**validated_data)
If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:
example_relationship = validated_data.pop('example_relationship') instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance
The default implementation also does not handle nested relationships. If you want to support writable nested relationships you'll need to write an explicit .create() method.
classroom.serializers.courses.CourseSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[소스]¶Bases: classroom.serializers.mixins.RemoveNullFieldsMixin, rest_framework.serializers.ModelSerializer
Meta[소스]¶Bases: object
extra_kwargs = {'link': {'view_name': 'courses-detail', 'lookup_field': 'id', 'lookup_url_kwarg': 'pk', 'read_only': True}}¶fields = ['link', 'id', 'name', 'path', 'description', 'webUrl', 'inviteUrl', 'summary', 'summaryFormat', 'startDate', 'endDate', 'staffs', 'createdAt', 'modifiedAt', 'students', 'assignmentStatus']¶model¶alias of classroom.models.courses.Course
create(validated_data)[소스]¶We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:
return ExampleModel.objects.create(**validated_data)
If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:
example_relationship = validated_data.pop('example_relationship') instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance
The default implementation also does not handle nested relationships. If you want to support writable nested relationships you'll need to write an explicit .create() method.
classroom.serializers.courses.CourseStudentSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[소스]¶