-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to model with choices and rename
- Loading branch information
Showing
7 changed files
with
98 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
class RecommendationChoiceType: | ||
SATISFIED = "SATISFIED" | ||
|
||
choices = [ | ||
(SATISFIED, "SATISFIED"), | ||
] | ||
|
||
|
||
class HelpfulGuidanceChoiceType: | ||
STRONGLY_DISAGREE = "STRONGLY DISAGREE" | ||
DISAGREE = "DISAGREE" | ||
NEITHER_AGREE_NOR_DISAGREE = "NEITHER AGREE NOR DISAGREE" | ||
AGREE = "AGREE" | ||
STRONGLY_AGREE = "STRONGLY AGREE" | ||
|
||
choices = [ | ||
(STRONGLY_DISAGREE, "STRONGLY DISAGREE"), | ||
(DISAGREE, "DISAGREE"), | ||
(NEITHER_AGREE_NOR_DISAGREE, "NEITHER AGREE NOR DISAGREE"), | ||
(AGREE, "AGREE"), | ||
(STRONGLY_AGREE, "STRONGLY AGREE"), | ||
] | ||
|
||
|
||
class UserAccountChoiceType: | ||
VERY_DIFFICULT = "VERY DIFFICULT" | ||
DIFFICULT = "DIFFICULT" | ||
NEITHER_DIFFICULT_NOR_EASY = "NEITHER DIFFICULT NOR EASY" | ||
EASY = "EASY" | ||
VERY_EASY = "VERY EASY" | ||
|
||
choices = [ | ||
(VERY_DIFFICULT, "VERY DIFFICULT"), | ||
(DIFFICULT, "DIFFICULT"), | ||
(NEITHER_DIFFICULT_NOR_EASY, "NEITHER DIFFICULT NOR EASY"), | ||
(EASY, "EASY"), | ||
(VERY_EASY, "VERY EASY"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateAPIView | ||
from rest_framework.generics import CreateAPIView, RetrieveUpdateAPIView | ||
|
||
from api.core.authentication import GovAuthentication, ExporterAuthentication | ||
from api.survey.models import Survey | ||
from api.core.authentication import ExporterAuthentication | ||
from api.survey.models import SurveyResponse | ||
from api.survey.serializers import SurveySerializer | ||
from api.conf.pagination import MaxPageNumberPagination | ||
|
||
|
||
# Create your views here. | ||
class SurveyListCreateAPIView(ListCreateAPIView): | ||
authentication_classes = (GovAuthentication, ExporterAuthentication) | ||
queryset = Survey.objects.all() | ||
class SurveyCreateAPIView(CreateAPIView): | ||
authentication_classes = (ExporterAuthentication,) | ||
queryset = SurveyResponse.objects.all() | ||
serializer_class = SurveySerializer | ||
pagination_class = MaxPageNumberPagination | ||
|
||
|
||
class SurveyDetailUpdateAPIView(RetrieveUpdateAPIView): | ||
authentication_classes = (GovAuthentication, ExporterAuthentication) | ||
queryset = Survey.objects.all() | ||
authentication_classes = (ExporterAuthentication,) | ||
queryset = SurveyResponse.objects.all() | ||
serializer_class = SurveySerializer |