Skip to content

Commit 337401d

Browse files
committed
feat: 세션 목록에 이벤트 로고가 응답되도록 수정
1 parent cdf3d94 commit 337401d

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

app/event/presentation/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_all_nested_data(self):
4040
to_attr="_prefetched_active_call_for_presentation_schedules",
4141
),
4242
)
43-
.select_related("image")
43+
.select_related("image", "type__event__logo")
4444
)
4545

4646

app/event/presentation/serializers.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
Presentation,
44
PresentationCategory,
55
PresentationSpeaker,
6+
PresentationType,
67
RoomSchedule,
78
)
9+
from event.serializers import EventSerializer
810
from rest_framework import serializers
911

1012

13+
class PresentationTypeSerializer(serializers.ModelSerializer):
14+
event = EventSerializer(read_only=True)
15+
16+
class Meta:
17+
model = PresentationType
18+
fields = ("id", "name", "event")
19+
20+
1121
class PresentationCategorySerializer(serializers.ModelSerializer):
1222
class Meta:
1323
model = PresentationCategory
@@ -40,6 +50,7 @@ class Meta:
4050

4151

4252
class PresentationSerializer(serializers.ModelSerializer):
53+
presentation_type = PresentationTypeSerializer(source="type", read_only=True)
4354
image = serializers.FileField(source="image.file", read_only=True, allow_null=True)
4455
categories = PresentationCategorySerializer(many=True, read_only=True, source="active_categories")
4556
speakers = PresentationSpeakerSerializer(many=True, read_only=True, source="active_speakers")
@@ -51,6 +62,7 @@ class Meta:
5162
model = Presentation
5263
fields = (
5364
"id",
65+
"presentation_type",
5466
"title",
5567
"summary",
5668
"description",

0 commit comments

Comments
 (0)