Skip to content

Commit e73ac96

Browse files
committed
refactor speaker children representation
1 parent c47bcd7 commit e73ac96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

roundware/api2/serializers.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ class Meta:
350350

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

355356
def to_representation(self, obj):
356357
result = super(SpeakerSerializer, self).to_representation(obj)

0 commit comments

Comments
 (0)