Skip to content

Commit

Permalink
feat : menu_id 보이게 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
redoyp committed Nov 18, 2024
1 parent 6ced71d commit 7652655
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 2 deletions.
Binary file modified config/__pycache__/settings.cpython-310.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
]



ROOT_URLCONF = 'config.urls'

TEMPLATES = [
Expand Down
Binary file modified foods/__pycache__/serializers.cpython-310.pyc
Binary file not shown.
Binary file modified foods/__pycache__/views.cpython-310.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion foods/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ class Meta:

# 메뉴에 속하는 음식들을 그룹화하는 Serializer
class MenuWithFoodsSerializer(serializers.Serializer):
menu_id = serializers.IntegerField()
menu_date = serializers.DateField()
restaurant_name = serializers.CharField()
time = serializers.CharField()
foods = FoodWithRatingsSummarySerializer(many=True)

class Meta:
fields = ['menu_date', 'restaurant_name', 'time', 'foods']
fields = ['menu_id', 'menu_date', 'restaurant_name', 'time', 'foods']
1 change: 1 addition & 0 deletions foods/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def get(self, request, *args, **kwargs):
food_data = FoodWithRatingsSummarySerializer(menu_foods, many=True).data

result.append({
'menu_id': menu.id,
'menu_date': menu.date,
'restaurant_name': restaurant.name,
'time': menu.time,
Expand Down

0 comments on commit 7652655

Please # to comment.