Commit d8af2e11 authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

add M5-M16 (need explanation on M11,M12,M13)

parent 60f5e7fa
from rest_framework import serializers from rest_framework import serializers
from reqman.apps.reqtool.models.main_req import Main, Main_M1, Main_M2, Main_M3, Main_M4 from reqman.apps.reqtool.models.main_req import Main, Main_M1, Main_M2, Main_M3, Main_M4
from reqman.apps.reqtool.models.main_req import Main_M5, Main_M6, Main_M7, Main_M8
from reqman.apps.reqtool.models.main_req import Main_M9, Main_M10, Main_M11, Main_M12
from reqman.apps.reqtool.models.main_req import Main_M13, Main_M14, Main_M15, Main_M16
class MainSerializer(serializers.ModelSerializer): class MainSerializer(serializers.ModelSerializer):
boilerplate_of_main = serializers.PrimaryKeyRelatedField(read_only=True) boilerplate_of_main = serializers.PrimaryKeyRelatedField(read_only=True)
...@@ -39,3 +43,103 @@ class Main_M4Serializer(serializers.ModelSerializer): ...@@ -39,3 +43,103 @@ class Main_M4Serializer(serializers.ModelSerializer):
class Meta: class Meta:
model = Main_M4 model = Main_M4
fields = ( 'id', 'boilerplate_of_m4', 'main_owner_of_m4', 'sys_fun_m4', 'shall_m4', 'quantifier_m4', 'numerical_m4', 'mumerical_units_m4', 'item_m4') fields = ( 'id', 'boilerplate_of_m4', 'main_owner_of_m4', 'sys_fun_m4', 'shall_m4', 'quantifier_m4', 'numerical_m4', 'mumerical_units_m4', 'item_m4')
class Main_M5Serializer(serializers.ModelSerializer):
boilerplate_of_m5 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m5 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M5
fields = ( 'id', 'boilerplate_of_m5', 'main_owner_of_m5', 'sys_fun_m5', 'shall_m5', 'flow_m5')
class Main_M6Serializer(serializers.ModelSerializer):
boilerplate_of_m6 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m6 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M6
fields = ( 'id', 'boilerplate_of_m6', 'main_owner_of_m6', 'sys_fun_m6', 'shall_m6', 'flow_m6')
class Main_M7Serializer(serializers.ModelSerializer):
boilerplate_of_m7 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m7 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M7
fields = ( 'id', 'boilerplate_of_m7', 'main_owner_of_m7', 'system_m7', 'shall_m7', 'function_m7')
class Main_M8Serializer(serializers.ModelSerializer):
boilerplate_of_m8 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m8 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M8
fields = ( 'id', 'boilerplate_of_m8', 'main_owner_of_m8', 'function_1_m8', 'shall_m8', 'function_2_m8')
class Main_M9Serializer(serializers.ModelSerializer):
boilerplate_of_m9 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m9 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M9
fields = ( 'id', 'boilerplate_of_m9', 'main_owner_of_m9', 'system_1_m9', 'shall_m9', 'interface_m9', 'system_2_m9')
class Main_M10Serializer(serializers.ModelSerializer):
boilerplate_of_m10 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m10 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M10
fields = ( 'id', 'boilerplate_of_m10', 'main_owner_of_m10', 'sys_inter_m10', 'shall_m10', 'flow_item_m9')
class Main_M11Serializer(serializers.ModelSerializer):
boilerplate_of_m11 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m11 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M11
fields = ( 'id', 'boilerplate_of_m11', 'main_owner_of_m11', 'system_1_m11', 'shall_m11', 'system_2_m11', 'connection_m11')
class Main_M12Serializer(serializers.ModelSerializer):
boilerplate_of_m12 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m12 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M12
fields = ( 'id', 'boilerplate_of_m12', 'main_owner_of_m12', 'system_m12', 'shall_m12', 'state_m12')
class Main_M13Serializer(serializers.ModelSerializer):
boilerplate_of_m13 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m13 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M13
fields = ( 'id', 'boilerplate_of_m13', 'main_owner_of_m13', 'system_m13', 'state_1_m13', 'statevalue_m13', 'shall_m13', 'state_2_m13')
class Main_M14Serializer(serializers.ModelSerializer):
boilerplate_of_m14 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m14 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M14
fields = ( 'id', 'boilerplate_of_m14', 'main_owner_of_m14', 'system_m14', 'item_m14', 'shall_m14')
class Main_M15Serializer(serializers.ModelSerializer):
boilerplate_of_m15 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m15 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M15
fields = ( 'id', 'boilerplate_of_m15', 'main_owner_of_m15', 'system_m15', 'item_1_m15', 'shall_m15', 'item_2_m15')
class Main_M16Serializer(serializers.ModelSerializer):
boilerplate_of_m16 = serializers.PrimaryKeyRelatedField(read_only=True)
main_owner_of_m16 = serializers.PrimaryKeyRelatedField(read_only=True)
class Meta:
model = Main_M16
fields = ( 'id', 'boilerplate_of_m16', 'main_owner_of_m16', 'system_1_m16', 'shall_m16', 'system_2_m16')
...@@ -31,16 +31,52 @@ urlpatterns = [ ...@@ -31,16 +31,52 @@ urlpatterns = [
path('requirements/<int:boilerplate>/main/', main_req_views.MainListCreateAPIView.as_view(), name='api-main-list'), path('requirements/<int:boilerplate>/main/', main_req_views.MainListCreateAPIView.as_view(), name='api-main-list'),
path('requirements/<int:boilerplate>/main/<int:pk>/', main_req_views.MainDetailsAPIView.as_view(), name='api-main-details'), path('requirements/<int:boilerplate>/main/<int:pk>/', main_req_views.MainDetailsAPIView.as_view(), name='api-main-details'),
#'''M1''' #'''M1'''
path('requirements/<int:boilerplate>/main/<int:mains>/m1', main_req_views.Main_M1ListCreateAPIView.as_view(), name='api-main-m1-list'), path('requirements/<int:boilerplate>/main/<int:mains>/m1/', main_req_views.Main_M1ListCreateAPIView.as_view(), name='api-main-m1-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m1/<int:pk>/', main_req_views.Main_M1DetailsAPIView.as_view(), name='api-main-m1-details'), path('requirements/<int:boilerplate>/main/<int:mains>/m1/<int:pk>/', main_req_views.Main_M1DetailsAPIView.as_view(), name='api-main-m1-details'),
#'''M2''' #'''M2'''
path('requirements/<int:boilerplate>/main/<int:mains>/m2', main_req_views.Main_M2ListCreateAPIView.as_view(), name='api-main-m2-list'), path('requirements/<int:boilerplate>/main/<int:mains>/m2/', main_req_views.Main_M2ListCreateAPIView.as_view(), name='api-main-m2-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m2/<int:pk>/', main_req_views.Main_M2DetailsAPIView.as_view(), name='api-main-m2-details'), path('requirements/<int:boilerplate>/main/<int:mains>/m2/<int:pk>/', main_req_views.Main_M2DetailsAPIView.as_view(), name='api-main-m2-details'),
#'''M3''' #'''M3'''
path('requirements/<int:boilerplate>/main/<int:mains>/m3', main_req_views.Main_M3ListCreateAPIView.as_view(), name='api-main-m3-list'), path('requirements/<int:boilerplate>/main/<int:mains>/m3/', main_req_views.Main_M3ListCreateAPIView.as_view(), name='api-main-m3-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m3/<int:pk>/', main_req_views.Main_M3DetailsAPIView.as_view(), name='api-main-m3-details'), path('requirements/<int:boilerplate>/main/<int:mains>/m3/<int:pk>/', main_req_views.Main_M3DetailsAPIView.as_view(), name='api-main-m3-details'),
#'''M4''' #'''M4'''
path('requirements/<int:boilerplate>/main/<int:mains>/m4', main_req_views.Main_M4ListCreateAPIView.as_view(), name='api-main-m4-list'), path('requirements/<int:boilerplate>/main/<int:mains>/m4/', main_req_views.Main_M4ListCreateAPIView.as_view(), name='api-main-m4-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m4/<int:pk>/', main_req_views.Main_M4DetailsAPIView.as_view(), name='api-main-m4-details'), path('requirements/<int:boilerplate>/main/<int:mains>/m4/<int:pk>/', main_req_views.Main_M4DetailsAPIView.as_view(), name='api-main-m4-details'),
#'''M5'''
path('requirements/<int:boilerplate>/main/<int:mains>/m5/', main_req_views.Main_M5ListCreateAPIView.as_view(), name='api-main-m5-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m5/<int:pk>/', main_req_views.Main_M5DetailsAPIView.as_view(), name='api-main-m5-details'),
#'''M6'''
path('requirements/<int:boilerplate>/main/<int:mains>/m6/', main_req_views.Main_M6ListCreateAPIView.as_view(), name='api-main-m6-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m6/<int:pk>/', main_req_views.Main_M6DetailsAPIView.as_view(), name='api-main-m6-details'),
#'''M7'''
path('requirements/<int:boilerplate>/main/<int:mains>/m7/', main_req_views.Main_M7ListCreateAPIView.as_view(), name='api-main-m7-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m7/<int:pk>/', main_req_views.Main_M7DetailsAPIView.as_view(), name='api-main-m7-details'),
#'''M8'''
path('requirements/<int:boilerplate>/main/<int:mains>/m8/', main_req_views.Main_M8ListCreateAPIView.as_view(), name='api-main-m8-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m8/<int:pk>/', main_req_views.Main_M8DetailsAPIView.as_view(), name='api-main-m8-details'),
#'''M9'''
path('requirements/<int:boilerplate>/main/<int:mains>/m9/', main_req_views.Main_M9ListCreateAPIView.as_view(), name='api-main-m9-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m9/<int:pk>/', main_req_views.Main_M9DetailsAPIView.as_view(), name='api-main-m9-details'),
#'''M10'''
path('requirements/<int:boilerplate>/main/<int:mains>/m10/', main_req_views.Main_M10ListCreateAPIView.as_view(), name='api-main-m10-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m10/<int:pk>/', main_req_views.Main_M10DetailsAPIView.as_view(), name='api-main-m10-details'),
#'''M11'''
path('requirements/<int:boilerplate>/main/<int:mains>/m11/', main_req_views.Main_M11ListCreateAPIView.as_view(), name='api-main-m11-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m11/<int:pk>/', main_req_views.Main_M11DetailsAPIView.as_view(), name='api-main-m11-details'),
#'''M12'''
path('requirements/<int:boilerplate>/main/<int:mains>/m12/', main_req_views.Main_M12ListCreateAPIView.as_view(), name='api-main-m12-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m12/<int:pk>/', main_req_views.Main_M12DetailsAPIView.as_view(), name='api-main-m12-details'),
#'''M13'''
path('requirements/<int:boilerplate>/main/<int:mains>/m13/', main_req_views.Main_M13ListCreateAPIView.as_view(), name='api-main-m13-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m13/<int:pk>/', main_req_views.Main_M13DetailsAPIView.as_view(), name='api-main-m13-details'),
#'''M14'''
path('requirements/<int:boilerplate>/main/<int:mains>/m14/', main_req_views.Main_M14ListCreateAPIView.as_view(), name='api-main-m14-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m14/<int:pk>/', main_req_views.Main_M14DetailsAPIView.as_view(), name='api-main-m14-details'),
#'''M15'''
path('requirements/<int:boilerplate>/main/<int:mains>/m15/', main_req_views.Main_M15ListCreateAPIView.as_view(), name='api-main-m15-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m15/<int:pk>/', main_req_views.Main_M15DetailsAPIView.as_view(), name='api-main-m15-details'),
#'''M16'''
path('requirements/<int:boilerplate>/main/<int:mains>/m16/', main_req_views.Main_M16ListCreateAPIView.as_view(), name='api-main-m16-list'),
path('requirements/<int:boilerplate>/main/<int:mains>/m16/<int:pk>/', main_req_views.Main_M16DetailsAPIView.as_view(), name='api-main-m16-details'),
] ]
\ No newline at end of file
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