from rest_framework import serializers from server.user.serializers import CustomUserDetailsSerializer from server.gym_program.serializers import GymProgramSerializer from .models import Appointment class AppointmentSerializer(serializers.ModelSerializer): user = CustomUserDetailsSerializer(read_only=True) gym_program = GymProgramSerializer(read_only=True) class Meta: model = Appointment fields = ('id', 'user', 'gym_program', 'start_date')