29 lines
619 B
Python
29 lines
619 B
Python
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
|
|
|