Skip to content

Commit

Permalink
refactor speaker children representation
Browse files Browse the repository at this point in the history
  • Loading branch information
hburgund committed Nov 20, 2024
1 parent c47bcd7 commit e73ac96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion roundware/api2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ class Meta:

def get_children(self, obj):
# Access the reverse relationship via `children`
return [child.id for child in obj.children.all()] # Return IDs of children
return obj.children.values_list('id', flat=True) # Return IDs of children


def to_representation(self, obj):
result = super(SpeakerSerializer, self).to_representation(obj)
Expand Down

0 comments on commit e73ac96

Please sign in to comment.