Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Requirement Formalization Tool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thodoris Nestoridis
Requirement Formalization Tool
Commits
76a7602c
Commit
76a7602c
authored
Feb 01, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new models
parent
3db478fe
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
119 additions
and
2512 deletions
+119
-2512
main_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
+30
-495
requirements.py
...ool/reqman/api/reqman/apps/reqtool/models/requirements.py
+57
-203
suffix_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/suffix_req.py
+15
-189
main_req.py
.../api/reqman/apps/reqtool/rest_api/serializers/main_req.py
+3
-136
requirements.py
.../reqman/apps/reqtool/rest_api/serializers/requirements.py
+4
-51
suffix_req.py
...pi/reqman/apps/reqtool/rest_api/serializers/suffix_req.py
+2
-50
urls.py
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
+0
-82
main_req_views.py
.../api/reqman/apps/reqtool/rest_api/views/main_req_views.py
+2
-793
requirements_views.py
.../reqman/apps/reqtool/rest_api/views/requirements_views.py
+4
-217
suffix_req_views.py
...pi/reqman/apps/reqtool/rest_api/views/suffix_req_views.py
+2
-296
No files found.
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
View file @
76a7602c
This diff is collapsed.
Click to expand it.
reqtool/reqman/api/reqman/apps/reqtool/models/requirements.py
View file @
76a7602c
This diff is collapsed.
Click to expand it.
reqtool/reqman/api/reqman/apps/reqtool/models/suffix_req.py
View file @
76a7602c
This diff is collapsed.
Click to expand it.
reqtool/reqman/api/reqman/apps/reqtool/rest_api/serializers/main_req.py
View file @
76a7602c
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_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
from
reqman.apps.reqtool.models.main_req
import
Main
class
MainSerializer
(
serializers
.
ModelSerializer
):
boilerplate_of_main
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
prefix_owner_of_main
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
main_owner
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Main
fields
=
(
'id'
,
'prefix_owner_of_main'
,
'boilerplate_of_main'
,
'main_choices'
)
class
Main_M1Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_m1
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
main_owner_of_m1
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Main_M1
fields
=
(
'id'
,
'boilerplate_of_m1'
,
'main_owner_of_m1'
,
'sys_fun_m1'
,
'shall_m1'
,
'quantifier_m1'
,
'numerical_m1'
,
'mumerical_units_m1'
,
'item_m1'
,
'statevalue_m1'
)
class
Main_M2Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_m2
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
main_owner_of_m2
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Main_M2
fields
=
(
'id'
,
'boilerplate_of_m2'
,
'main_owner_of_m2'
,
'sys_fun_m2'
,
'shall_m2'
,
'state_m2'
,
'statevalue_m2'
)
class
Main_M3Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_m3
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
main_owner_of_m3
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Main_M3
fields
=
(
'id'
,
'boilerplate_of_m3'
,
'main_owner_of_m3'
,
'sys_fun_m3'
,
'shall_m3'
,
'quantifier_m3'
,
'numerical_m3'
,
'mumerical_units_m3'
,
'item_m3'
)
class
Main_M4Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_m4
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
main_owner_of_m4
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
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'
)
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'
)
fields
=
'__all__'
reqtool/reqman/api/reqman/apps/reqtool/rest_api/serializers/requirements.py
View file @
76a7602c
from
rest_framework
import
serializers
from
reqman.apps.reqtool.models.requirements
import
Prefix
,
Boilerplate
,
LogicalExpression
,
OccuringFunctionalityP2
,
StateValueConstraint
,
OccuringFunctionalityForLogicalExpression
,
OccuringFunctionalityP3
from
reqman.apps.reqtool.models.requirements
import
Prefix
,
Boilerplate
class
BoilerplateSerializer
(
serializers
.
ModelSerializer
):
owner
=
serializers
.
ReadOnlyField
(
source
=
'owner.username'
)
...
...
@@ -9,55 +9,8 @@ class BoilerplateSerializer(serializers.ModelSerializer):
class
PrefixSerializer
(
serializers
.
ModelSerializer
):
boilerplate
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
prefix_owner
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Prefix
fields
=
(
'id'
,
'prefix_owner'
,
'boilerplate'
,
'simple_prefix_1'
,
'logic_connective_1'
,
'simple_prefix_2'
,
'logic_connective_2'
,
'simple_prefix_3'
)
class
LogicalExpressionSerializer
(
serializers
.
ModelSerializer
):
prefix
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
prefix_boilerplate
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
prefix_series
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
LogicalExpression
fields
=
(
'id'
,
'prefix'
,
'prefix_series'
,
'prefix_boilerplate'
,
'logical_expression_1'
,
'logic_connective_1'
,
'logical_expression_2'
,
'logic_connective_2'
,
'logical_expression_3'
)
class
OccuringFunctionalityP2Serializer
(
serializers
.
ModelSerializer
):
prefix_of_occuring_functionality_p2
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
prefix_boilerplate_of_occuring_functionality_p2
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
prefix_series_of_occuring_functionality_p2
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
OccuringFunctionalityP2
fields
=
(
'id'
,
'prefix_of_occuring_functionality_p2'
,
'prefix_boilerplate_of_occuring_functionality_p2'
,
'prefix_series_of_occuring_functionality_p2'
,
'system_for_occuring_functionality_p2'
,
'perform_for_occuring_functionality_p2'
,
'function_for_occuring_functionality_p2'
,
'item_for_occuring_functionality_p2'
,
'flow_for_occuring_functionality_p2'
)
class
OccuringFunctionalityP3Serializer
(
serializers
.
ModelSerializer
):
prefix_of_occuring_functionality_p3
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
prefix_boilerplate_of_occuring_functionality_p3
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
prefix_series_of_occuring_functionality_p3
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
OccuringFunctionalityP3
fields
=
(
'id'
,
'prefix_of_occuring_functionality_p3'
,
'prefix_boilerplate_of_occuring_functionality_p3'
,
'prefix_series_of_occuring_functionality_p3'
,
'system_for_occuring_functionality_p3'
,
'perform_for_occuring_functionality_p3'
,
'function_for_occuring_functionality_p3'
,
'item_for_occuring_functionality_p3'
,
'flow_for_occuring_functionality_p3'
)
class
StateValueConstraintSerializer
(
serializers
.
ModelSerializer
):
prefix_of_logical_expression
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
logical_expression
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
log_expr_series
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
prefixgroup
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
StateValueConstraint
fields
=
(
'id'
,
'prefix_of_logical_expression'
,
'logical_expression'
,
'log_expr_series'
,
'item'
,
'system_state'
,
'state_value'
)
class
OccuringFunctionalityForLogicalExpressionSerializer
(
serializers
.
ModelSerializer
):
prefix_of_occuring_for_logical_expression
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
logical_expression_of_occuring
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
log_expres_series
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
OccuringFunctionalityForLogicalExpression
fields
=
(
'id'
,
'prefix_of_occuring_for_logical_expression'
,
'logical_expression_of_occuring'
,
'log_expres_series'
,
'system_for_logical_expression'
,
'perform_for_logical_expression'
,
'function_for_logical_expression'
,
'item_for_logical_expression'
)
model
=
Prefix
fields
=
'__all__'
reqtool/reqman/api/reqman/apps/reqtool/rest_api/serializers/suffix_req.py
View file @
76a7602c
from
rest_framework
import
serializers
from
reqman.apps.reqtool.models.suffix_req
import
Suffix
,
Suffix_S1
,
Suffix_S2
,
Suffix_S3
,
Suffix_S4
,
Suffix_S5
,
Suffix_S6
from
reqman.apps.reqtool.models.suffix_req
import
Suffix
class
SuffixSerializer
(
serializers
.
ModelSerializer
):
...
...
@@ -7,53 +7,5 @@ class SuffixSerializer(serializers.ModelSerializer):
suffix_owner
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Suffix
fields
=
(
'id'
,
'boilerplate_of_suffix'
,
'suffix_owner'
,
'suffix_choices'
)
class
Suffix_S1Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_s1
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
suffix_owner_of_s1
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Suffix_S1
fields
=
(
'id'
,
'boilerplate_of_s1'
,
'suffix_owner_of_s1'
,
'numerical_affirmative_s1'
,
'numerical_s1'
,
'mumerical_units_s1'
,
'time_units_s1'
)
class
Suffix_S2Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_s2
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
suffix_owner_of_s2
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Suffix_S2
fields
=
(
'id'
,
'boilerplate_of_s2'
,
'suffix_owner_of_s2'
,
's2_s2'
,
'flow_s2'
)
class
Suffix_S3Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_s3
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
suffix_owner_of_s3
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Suffix_S3
fields
=
(
'id'
,
'boilerplate_of_s3'
,
'suffix_owner_of_s3'
,
's3_s3'
,
'numerical_s3'
,
'time_units_s3'
,
'flow_s3'
)
class
Suffix_S4Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_s4
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
suffix_owner_of_s4
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Suffix_S4
fields
=
(
'id'
,
'boilerplate_of_s4'
,
'suffix_owner_of_s4'
,
's4_s4'
)
class
Suffix_S5Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_s5
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
suffix_owner_of_s5
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Suffix_S5
fields
=
(
'id'
,
'boilerplate_of_s5'
,
'suffix_owner_of_s5'
,
's5_s5'
)
class
Suffix_S6Serializer
(
serializers
.
ModelSerializer
):
boilerplate_of_s6
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
suffix_owner_of_s6
=
serializers
.
PrimaryKeyRelatedField
(
read_only
=
True
)
class
Meta
:
model
=
Suffix_S6
fields
=
(
'id'
,
'boilerplate_of_s6'
,
'suffix_owner_of_s6'
,
's6_s6'
)
fields
=
'__all__'
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
View file @
76a7602c
...
...
@@ -11,94 +11,12 @@ urlpatterns = [
#'''Prefix'''
path
(
'requirements/<int:boilerplate>/prefix/'
,
requirements_views
.
PrefixListAPIView
.
as_view
(),
name
=
'api-prefix-list'
),
path
(
'requirements/<int:boilerplate>/prefix/<int:pk>/'
,
requirements_views
.
PrefixDetailsAPIView
.
as_view
(),
name
=
'api-prefix-details'
),
#'''P1'''
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p1/'
,
requirements_views
.
LogicalExpressionListAPIView
.
as_view
(),
name
=
'api-log_expr-list'
),
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p1/<int:pk>/'
,
requirements_views
.
LogicalExpressionDetailsAPIView
.
as_view
(),
name
=
'api-log_expr-details'
),
#'''P2'''
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p2/'
,
requirements_views
.
OccuringFunctionalityP2ListAPIView
.
as_view
(),
name
=
'api-occur_func-list'
),
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p2/<int:pk>/'
,
requirements_views
.
OccuringFunctionalityP2DetailsAPIView
.
as_view
(),
name
=
'api-occur_func-details'
),
#'''P3'''
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p3/'
,
requirements_views
.
OccuringFunctionalityP3ListAPIView
.
as_view
(),
name
=
'api-occur_func_p3-list'
),
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p3/<int:pk>/'
,
requirements_views
.
OccuringFunctionalityP3DetailsAPIView
.
as_view
(),
name
=
'api-occur_func_p3-details'
),
#'''Logical expression of P1'''
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p1/<int:log_expr>/constraint/'
,
requirements_views
.
StateValueConstraintListAPIView
.
as_view
(),
name
=
'api-constraint-list'
),
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p1/<int:log_expr>/constraint/<int:pk>/'
,
requirements_views
.
StateValueConstraintDetailsAPIView
.
as_view
(),
name
=
'api-constraint-details'
),
#'''Occuring functionality of P1'''
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p1/<int:log_expr>/functionality/'
,
requirements_views
.
OccuringFunctionalityForLogicalExpressionListAPIView
.
as_view
(),
name
=
'api-functionality-for-log-list'
),
path
(
'requirements/<int:boilerplate>/prefix/<int:prefixs>/p1/<int:log_expr>/functionality/<int:pk>/'
,
requirements_views
.
OccuringFunctionalityForLogicalExpressionDetailsAPIView
.
as_view
(),
name
=
'api-functionality-for-log-list'
),
#'''MAIN'''
path
(
'requirements/<int:boilerplate>/main/'
,
main_req_views
.
MainListAPIView
.
as_view
(),
name
=
'api-main-list'
),
path
(
'requirements/<int:boilerplate>/main/<int:pk>/'
,
main_req_views
.
MainDetailsAPIView
.
as_view
(),
name
=
'api-main-details'
),
#'''M1'''
path
(
'requirements/<int:boilerplate>/main/<int:mains>/m1/'
,
main_req_views
.
Main_M1ListAPIView
.
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'
),
#'''M2'''
path
(
'requirements/<int:boilerplate>/main/<int:mains>/m2/'
,
main_req_views
.
Main_M2ListAPIView
.
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'
),
#'''M3'''
path
(
'requirements/<int:boilerplate>/main/<int:mains>/m3/'
,
main_req_views
.
Main_M3ListAPIView
.
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'
),
#'''M4'''
path
(
'requirements/<int:boilerplate>/main/<int:mains>/m4/'
,
main_req_views
.
Main_M4ListAPIView
.
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'
),
#'''M5'''
path
(
'requirements/<int:boilerplate>/main/<int:mains>/m5/'
,
main_req_views
.
Main_M5ListAPIView
.
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_M6ListAPIView
.
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_M7ListAPIView
.
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_M8ListAPIView
.
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_M9ListAPIView
.
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_M10ListAPIView
.
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_M11ListAPIView
.
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_M12ListAPIView
.
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_M13ListAPIView
.
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_M14ListAPIView
.
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_M15ListAPIView
.
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_M16ListAPIView
.
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'
),
#'''SUFFIX'''
path
(
'requirements/<int:boilerplate>/suffix/'
,
suffix_req_views
.
SuffixListAPIView
.
as_view
(),
name
=
'api-suffix-list'
),
path
(
'requirements/<int:boilerplate>/suffix/<int:pk>/'
,
suffix_req_views
.
SuffixDetailsAPIView
.
as_view
(),
name
=
'api-suffix-details'
),
#'''S1'''
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s1/'
,
suffix_req_views
.
Suffix_S1ListAPIView
.
as_view
(),
name
=
'api-suffix-s1-list'
),
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s1/<int:pk>/'
,
suffix_req_views
.
Suffix_S1DetailsAPIView
.
as_view
(),
name
=
'api-suffix-s1-details'
),
#'''S2'''
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s2/'
,
suffix_req_views
.
Suffix_S2ListAPIView
.
as_view
(),
name
=
'api-suffix-s2-list'
),
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s2/<int:pk>/'
,
suffix_req_views
.
Suffix_S2DetailsAPIView
.
as_view
(),
name
=
'api-suffix-s2-details'
),
#'''S3'''
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s3/'
,
suffix_req_views
.
Suffix_S3ListAPIView
.
as_view
(),
name
=
'api-suffix-s3-list'
),
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s3/<int:pk>/'
,
suffix_req_views
.
Suffix_S3DetailsAPIView
.
as_view
(),
name
=
'api-suffix-s3-details'
),
#'''S4'''
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s4/'
,
suffix_req_views
.
Suffix_S4ListAPIView
.
as_view
(),
name
=
'api-suffix-s4-list'
),
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s4/<int:pk>/'
,
suffix_req_views
.
Suffix_S4DetailsAPIView
.
as_view
(),
name
=
'api-suffix-s4-details'
),
#'''S5'''
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s5/'
,
suffix_req_views
.
Suffix_S5ListAPIView
.
as_view
(),
name
=
'api-suffix-s5-list'
),
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s5/<int:pk>/'
,
suffix_req_views
.
Suffix_S5DetailsAPIView
.
as_view
(),
name
=
'api-suffix-s5-details'
),
#'''S6'''
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s6/'
,
suffix_req_views
.
Suffix_S6ListAPIView
.
as_view
(),
name
=
'api-suffix-s6-list'
),
path
(
'requirements/<int:boilerplate>/suffix/<int:suffixs>/s6/<int:pk>/'
,
suffix_req_views
.
Suffix_S6DetailsAPIView
.
as_view
(),
name
=
'api-suffix-s6-details'
),
]
\ No newline at end of file
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/main_req_views.py
View file @
76a7602c
This diff is collapsed.
Click to expand it.
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/requirements_views.py
View file @
76a7602c
...
...
@@ -5,8 +5,8 @@ from django.http import HttpResponse, JsonResponse
from
django.views.decorators.csrf
import
csrf_exempt
from
rest_framework.parsers
import
JSONParser
from
reqman.apps.reqtool.models.requirements
import
Prefix
,
Boilerplate
,
LogicalExpression
,
OccuringFunctionalityP2
,
OccuringFunctionalityP3
,
StateValueConstraint
,
OccuringFunctionalityForLogicalExpression
from
reqman.apps.reqtool.rest_api.serializers.requirements
import
PrefixSerializer
,
BoilerplateSerializer
,
LogicalExpressionSerializer
,
OccuringFunctionalityP2Serializer
,
OccuringFunctionalityP3Serializer
,
StateValueConstraintSerializer
,
OccuringFunctionalityForLogicalExpressionSerializer
from
reqman.apps.reqtool.models.requirements
import
Prefix
,
Boilerplate
from
reqman.apps.reqtool.rest_api.serializers.requirements
import
PrefixSerializer
,
BoilerplateSerializer
from
reqman.apps.permissions
import
IsOwnerOrReadOnly
from
reqman.apps.reqtool.rest_api.services
import
fuseki
...
...
@@ -64,7 +64,7 @@ class PrefixListAPIView(ListAPIView):
def
get_queryset
(
self
):
group_pk
=
self
.
kwargs
[
'boilerplate'
]
#print(group_pk)
queryset_prefix
=
Prefix
.
objects
.
filter
(
boilerplate
=
group_pk
)
queryset_prefix
=
Prefix
.
objects
.
filter
(
prefix_
boilerplate
=
group_pk
)
return
queryset_prefix
#Custom actions when POST
...
...
@@ -85,8 +85,7 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
def
get_queryset
(
self
):
group_pk
=
self
.
kwargs
[
'boilerplate'
]
#print(group_pk)
queryset_prefix
=
Prefix
.
objects
.
filter
(
boilerplate
=
group_pk
)
queryset_prefix
=
Prefix
.
objects
.
filter
(
prefix_boilerplate
=
group_pk
)
return
queryset_prefix
#Custom actions when PUT
...
...
@@ -102,215 +101,3 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
#print("deleted")
instance
.
delete
()
class
LogicalExpressionListAPIView
(
ListAPIView
):
"""
API view to retrieve list of posts or create new
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
LogicalExpressionSerializer
#queryset = LogicalExpression.objects.all()
def
get_queryset
(
self
):
bp
=
self
.
kwargs
[
'boilerplate'
]
pr
=
self
.
kwargs
[
'prefixs'
]
queryset_prefix
=
LogicalExpression
.
objects
.
filter
(
prefix_boilerplate
=
bp
,
prefix
=
pr
)
return
queryset_prefix
#Custom actions when POST
def
perform_create
(
self
,
serializer
):
serializer
.
save
()
#print the data of the post
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
class
LogicalExpressionDetailsAPIView
(
RetrieveUpdateDestroyAPIView
):
"""
API view to retrieve, update or delete post
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
LogicalExpressionSerializer
queryset
=
LogicalExpression
.
objects
.
all
()
#Custom actions when PUT
def
perform_update
(
self
,
serializer
):
instance
=
serializer
.
save
()
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
#Custom actions when DELETE
def
perform_destroy
(
self
,
instance
):
#print("deleted")
instance
.
delete
()
class
OccuringFunctionalityP2ListAPIView
(
ListAPIView
):
"""
API view to retrieve list of posts or create new
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
OccuringFunctionalityP2Serializer
#queryset = LogicalExpression.objects.all()
def
get_queryset
(
self
):
bp
=
self
.
kwargs
[
'boilerplate'
]
pr
=
self
.
kwargs
[
'prefixs'
]
queryset_prefix
=
OccuringFunctionalityP2
.
objects
.
filter
(
prefix_boilerplate_of_occuring_functionality_p2
=
bp
,
prefix_of_occuring_functionality_p2
=
pr
)
return
queryset_prefix
#Custom actions when POST
def
perform_create
(
self
,
serializer
):
serializer
.
save
()
#print the data of the post
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
class
OccuringFunctionalityP2DetailsAPIView
(
RetrieveUpdateDestroyAPIView
):
"""
API view to retrieve, update or delete post
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
OccuringFunctionalityP2Serializer
queryset
=
OccuringFunctionalityP2
.
objects
.
all
()
#Custom actions when PUT
def
perform_update
(
self
,
serializer
):
instance
=
serializer
.
save
()
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
#Custom actions when DELETE
def
perform_destroy
(
self
,
instance
):
#print("deleted")
instance
.
delete
()
class
OccuringFunctionalityP3ListAPIView
(
ListAPIView
):
"""
API view to retrieve list of posts or create new
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
OccuringFunctionalityP3Serializer
#queryset = LogicalExpression.objects.all()
def
get_queryset
(
self
):
bp
=
self
.
kwargs
[
'boilerplate'
]
pr
=
self
.
kwargs
[
'prefixs'
]
queryset_prefix
=
OccuringFunctionalityP3
.
objects
.
filter
(
prefix_boilerplate_of_occuring_functionality_p3
=
bp
,
prefix_of_occuring_functionality_p3
=
pr
)
return
queryset_prefix
#Custom actions when POST
def
perform_create
(
self
,
serializer
):
serializer
.
save
()
#print the data of the post
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
class
OccuringFunctionalityP3DetailsAPIView
(
RetrieveUpdateDestroyAPIView
):
"""
API view to retrieve, update or delete post
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
OccuringFunctionalityP3Serializer
queryset
=
OccuringFunctionalityP3
.
objects
.
all
()
#Custom actions when PUT
def
perform_update
(
self
,
serializer
):
instance
=
serializer
.
save
()
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
#Custom actions when DELETE
def
perform_destroy
(
self
,
instance
):
#print("deleted")
instance
.
delete
()
class
StateValueConstraintListAPIView
(
ListAPIView
):
"""
API view to retrieve list of posts or create new
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
StateValueConstraintSerializer
#queryset = StateValueConstraint.objects.all()
def
get_queryset
(
self
):
le
=
self
.
kwargs
[
'log_expr'
]
pr
=
self
.
kwargs
[
'prefixs'
]
queryset_prefix
=
StateValueConstraint
.
objects
.
filter
(
logical_expression
=
le
,
prefix_of_logical_expression
=
pr
)
return
queryset_prefix
#Custom actions when POST
def
perform_create
(
self
,
serializer
):
serializer
.
save
()
#print the data of the post
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
class
StateValueConstraintDetailsAPIView
(
RetrieveUpdateDestroyAPIView
):
"""
API view to retrieve, update or delete post
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
StateValueConstraintSerializer
queryset
=
StateValueConstraint
.
objects
.
all
()
#Custom actions when PUT
def
perform_update
(
self
,
serializer
):
instance
=
serializer
.
save
()
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
#Custom actions when DELETE
def
perform_destroy
(
self
,
instance
):
#print("deleted")
instance
.
delete
()
class
OccuringFunctionalityForLogicalExpressionListAPIView
(
ListAPIView
):
"""
API view to retrieve list of posts or create new
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
OccuringFunctionalityForLogicalExpressionSerializer
#queryset = StateValueConstraint.objects.all()
def
get_queryset
(
self
):
le
=
self
.
kwargs
[
'log_expr'
]
pr
=
self
.
kwargs
[
'prefixs'
]
queryset_prefix
=
OccuringFunctionalityForLogicalExpression
.
objects
.
filter
(
logical_expression_of_occuring
=
le
,
prefix_of_occuring_for_logical_expression
=
pr
)
return
queryset_prefix
#Custom actions when POST
def
perform_create
(
self
,
serializer
):
serializer
.
save
()
#print the data of the post
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
class
OccuringFunctionalityForLogicalExpressionDetailsAPIView
(
RetrieveUpdateDestroyAPIView
):
"""
API view to retrieve, update or delete post
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
OccuringFunctionalityForLogicalExpressionSerializer
queryset
=
OccuringFunctionalityForLogicalExpression
.
objects
.
all
()
#Custom actions when PUT
def
perform_update
(
self
,
serializer
):
instance
=
serializer
.
save
()
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
#Custom actions when DELETE
def
perform_destroy
(
self
,
instance
):
#print("deleted")
instance
.
delete
()
\ No newline at end of file
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/suffix_req_views.py
View file @
76a7602c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment