Fakultas Ilmu Komputer UI

serializers.py 529 Bytes
Newer Older
Muzaki Azami's avatar
Muzaki Azami committed
1
2
from rest_framework import serializers, fields
from constants.model_choices import PhysicalActivity
3
from .models import WeeklyReport, WeeklyReportComment
Muzaki Azami's avatar
Muzaki Azami committed
4
5
6
7
8
9
10
11
12


class WeeklyReportSerializer(serializers.ModelSerializer):
    physical_activity = fields.MultipleChoiceField(
        choices=PhysicalActivity.choices)

    class Meta:
        model = WeeklyReport
        fields = "__all__"
13
14
15
16
17
18


class WeeklyReportCommentSerializer(serializers.ModelSerializer):
    class Meta:
        model = WeeklyReportComment
        fields = "__all__"