Commit b5b3130b authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

add urls for angular

parent 51e5a9c3
...@@ -29,4 +29,22 @@ urlpatterns = [ ...@@ -29,4 +29,22 @@ urlpatterns = [
path('prefix/choices/sysfunitem/', requirements_views.FunItemSysChoicesViewSet.as_view(), name='sysfunitem'), path('prefix/choices/sysfunitem/', requirements_views.FunItemSysChoicesViewSet.as_view(), name='sysfunitem'),
path('prefix/choices/staflowfunitem/', requirements_views.StaFlowFunItemChoicesViewSet.as_view(), name='staflowfunitem'), path('prefix/choices/staflowfunitem/', requirements_views.StaFlowFunItemChoicesViewSet.as_view(), name='staflowfunitem'),
#MAIN CHOICES DATA
path('main/choices/subject/', main_req_views.SysFunIntChoicesViewSet.as_view(), name='mainsubject'),
path('main/choices/stateitem/', main_req_views.StatItemChoicesViewSet.as_view(), name='mainstateitem'),
path('main/choices/statevalue/', main_req_views.StatevalueChoicesViewSet.as_view(), name='mainstatevalue'),
path('main/choices/shall/', main_req_views.ShallChoicesViewSet.as_view(), name='mainshall'),
path('main/choices/verb/', main_req_views.VerbChoicesViewSet.as_view(), name='mainverb'),
path('main/choices/quantifier/', main_req_views.QuantChoicesViewSet.as_view(), name='mainquantifier'),
path('main/choices/numunit/', main_req_views.NumUnitChoicesViewSet.as_view(), name='mainnumunit'),
path('main/choices/fifuintsysstatset/', main_req_views.FlFuIntItSysStatSetChoicesViewSet.as_view(), name='mainfifuintsysstatset'),
path('main/choices/stsysconset/', main_req_views.StaSysConSetChoicesViewSet.as_view(), name='mainstsysconset'),
#SUFFIX CHOICES DATA
path('suffix/choices/suffix/', suffix_req_views.SuffixChoicesViewSet.as_view(), name='suffixsuffix'),
path('suffix/choices/numunits/', suffix_req_views.NumChoicesViewSet.as_view(), name='suffixnum'),
path('suffix/choices/timeunits/', suffix_req_views.TimeChoicesViewSet.as_view(), name='suffixtime'),
path('suffix/choices/flow/', suffix_req_views.FlowChoicesViewSet.as_view(), name='suffixflow'),
] ]
\ No newline at end of file
...@@ -11,6 +11,13 @@ from reqman.apps.reqtool.rest_api.serializers.main_req import MainSerializer ...@@ -11,6 +11,13 @@ from reqman.apps.reqtool.rest_api.serializers.main_req import MainSerializer
from reqman.apps.permissions import IsOwnerOrReadOnly from reqman.apps.permissions import IsOwnerOrReadOnly
from reqman.apps.reqtool.rest_api.services import fuseki from reqman.apps.reqtool.rest_api.services import fuseki
from rest_framework.response import Response
from rest_framework.views import APIView
from reqman.apps.reqtool.models.main_req import SYSTEM_CHOICES, FUNCTION_CHOICES, INTERFACE_CHOICES, STATE_CHOICES, ITEM_CHOICES
from reqman.apps.reqtool.models.main_req import STATE_VALUE_CHOICES, SHALL_CHOICES, VERB_CHOICES, QUANTIFIER_CHOICES, NUMBER_UNITS_CHOICES
from reqman.apps.reqtool.models.main_req import FLOW_CHOICES, CONNECTION_CHOICES
class MainListAPIView(ListAPIView): class MainListAPIView(ListAPIView):
""" """
API view to retrieve list of posts or create new API view to retrieve list of posts or create new
...@@ -61,3 +68,64 @@ class MainDetailsAPIView(RetrieveUpdateDestroyAPIView): ...@@ -61,3 +68,64 @@ class MainDetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete() instance.delete()
class SysFunIntChoicesViewSet(APIView):
def get(self, request):
response = Response(SYSTEM_CHOICES + FUNCTION_CHOICES + INTERFACE_CHOICES)
return response
class StatItemChoicesViewSet(APIView):
def get(self, request):
response = Response(STATE_CHOICES + ITEM_CHOICES)
return response
class StatevalueChoicesViewSet(APIView):
def get(self, request):
response = Response(STATE_VALUE_CHOICES)
return response
class ShallChoicesViewSet(APIView):
def get(self, request):
response = Response(SHALL_CHOICES)
return response
class VerbChoicesViewSet(APIView):
def get(self, request):
response = Response(VERB_CHOICES)
return response
class QuantChoicesViewSet(APIView):
def get(self, request):
response = Response(QUANTIFIER_CHOICES)
return response
class NumUnitChoicesViewSet(APIView):
def get(self, request):
response = Response(NUMBER_UNITS_CHOICES)
return response
class FlFuIntItSysStatSetChoicesViewSet(APIView):
def get(self, request):
response = Response(FLOW_CHOICES + FUNCTION_CHOICES + INTERFACE_CHOICES + ITEM_CHOICES + SYSTEM_CHOICES +STATE_CHOICES + STATE_SET_CHOICES)
return response
class StaSysConSetChoicesViewSet(APIView):
def get(self, request):
response = Response(STATE_VALUE_CHOICES + SYSTEM_CHOICES + CONNECTION_CHOICES + STATE_SET_CHOICES)
return response
...@@ -11,6 +11,12 @@ from reqman.apps.reqtool.rest_api.serializers.suffix_req import SuffixSerializer ...@@ -11,6 +11,12 @@ from reqman.apps.reqtool.rest_api.serializers.suffix_req import SuffixSerializer
from reqman.apps.permissions import IsOwnerOrReadOnly from reqman.apps.permissions import IsOwnerOrReadOnly
from reqman.apps.reqtool.rest_api.services import fuseki from reqman.apps.reqtool.rest_api.services import fuseki
from rest_framework.response import Response
from rest_framework.views import APIView
from reqman.apps.reqtool.models.suffix_req import S_CHOICES, NUMBER_UNITS_CHOICES, TIME_UNITS_CHOICES, FLOW_CHOICES
class SuffixListAPIView(ListAPIView): class SuffixListAPIView(ListAPIView):
""" """
API view to retrieve list of posts or create new API view to retrieve list of posts or create new
...@@ -61,4 +67,30 @@ class SuffixDetailsAPIView(RetrieveUpdateDestroyAPIView): ...@@ -61,4 +67,30 @@ class SuffixDetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete() instance.delete()
class SuffixChoicesViewSet(APIView):
def get(self, request):
response = Response(S_CHOICES)
return response
class NumChoicesViewSet(APIView):
def get(self, request):
response = Response(NUMBER_UNITS_CHOICES)
return response
class TimeChoicesViewSet(APIView):
def get(self, request):
response = Response(TIME_UNITS_CHOICES)
return response
class FlowChoicesViewSet(APIView):
def get(self, request):
response = Response(FLOW_CHOICES)
return response
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment