SOITA/questionnaire/serializers.py

29 lines
619 B
Python
Raw Normal View History

2022-05-15 22:12:32 +02:00
from rest_framework import serializers
from questionnaire.models import Questionnaire
class QuestionnaireSerializer(serializers.ModelSerializer):
class Meta:
model = Questionnaire
fields = (
"id",
"overall",
"functionality",
"look",
"intuitive",
"bugs",
"tech",
"potential",
"worst",
"desc",
"fill_by"
)
def create(self, validated_data):
instance = Questionnaire.objects.create(
**validated_data
)
return instance