|
|
@ -8,10 +8,15 @@ from apps.course.serializers import CourseDetailSerializer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ParticipantInfoSerializer(serializers.ModelSerializer): |
|
|
class ParticipantInfoSerializer(serializers.ModelSerializer): |
|
|
|
|
|
phone_number = serializers.CharField(max_length=30) |
|
|
|
|
|
|
|
|
class Meta: |
|
|
class Meta: |
|
|
model = ParticipantInfo |
|
|
model = ParticipantInfo |
|
|
fields = ['fullname', 'email', 'phone_number', 'gender', 'birthdate'] |
|
|
fields = ['fullname', 'email', 'phone_number', 'gender', 'birthdate'] |
|
|
|
|
|
|
|
|
|
|
|
def validate_phone_number(self, value): |
|
|
|
|
|
return value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TransactionParticipantSerializer(serializers.ModelSerializer): |
|
|
class TransactionParticipantSerializer(serializers.ModelSerializer): |
|
|
participant_infos = ParticipantInfoSerializer(many=True) |
|
|
participant_infos = ParticipantInfoSerializer(many=True) |
|
|
|