Skip to content

Commit

Permalink
separate appointment serializer for parent app
Browse files Browse the repository at this point in the history
  • Loading branch information
bbonf committed Oct 29, 2024
1 parent 9661920 commit 396e4c0
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions lab/experiments/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,34 @@ class Meta:
"excluded_experiments",
"defaultcriteria",
]


class ParentAppointmentSerializer(serializers.ModelSerializer):
class Meta:
model = Appointment
fields = [
"id",
"experiment",
"leader",
"participant",
"location",
"start",
"end",
"comment",
"outcome",
"contact_phone",
"session_duration",
]

experiment = serializers.ReadOnlyField(source="experiment.name")
participant = serializers.ReadOnlyField(source="participant.name")

location = serializers.ReadOnlyField()
leader = serializers.ReadOnlyField(source="leader.name")

contact_phone = serializers.ReadOnlyField(source="leader.phonenumber")

start = serializers.DateTimeField()
end = serializers.DateTimeField()

session_duration = serializers.ReadOnlyField(source="experiment.session_duration")

0 comments on commit 396e4c0

Please sign in to comment.