SOITA/trials/serializers.py
Hubert Jankowski 539c4690cb changers
2021-12-05 13:50:34 +01:00

19 lines
398 B
Python

from rest_framework import serializers
from questions.serializers import QuestionSerializer
from trials.models import Test
class TestSerializer(serializers.ModelSerializer):
questions = QuestionSerializer(many=True, required=False)
class Meta:
model = Test
fields = (
"id",
"name",
"passing_score",
"questions"
)