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
08e9211f
Commit
08e9211f
authored
Jul 13, 2023
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access to api (semantic analysis, property list)
parent
9f2ebd86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
requirements.py
...ool/reqman/api/reqman/apps/reqtool/models/requirements.py
+1
-1
requirements_views.py
.../reqman/apps/reqtool/rest_api/views/requirements_views.py
+10
-1
No files found.
reqtool/reqman/api/reqman/apps/reqtool/models/requirements.py
View file @
08e9211f
...
@@ -88,7 +88,7 @@ def create_infer_result(instance, destination):
...
@@ -88,7 +88,7 @@ def create_infer_result(instance, destination):
def
initialize_instances
(
instance
):
def
initialize_instances
(
instance
):
try
:
try
:
g
=
Graph
()
g
=
Graph
()
file_name
=
instance
.
title_bgroup
.
replace
(
'/'
,
''
)
file_name
=
instance
.
title_bgroup
.
replace
(
'/'
,
''
)
.
replace
(
' '
,
'_'
)
save_path
=
"../../Ontologies/"
+
file_name
+
"/"
save_path
=
"../../Ontologies/"
+
file_name
+
"/"
if
(
os
.
path
.
exists
(
"../../Ontologies/"
+
file_name
+
"/"
)
==
False
):
if
(
os
.
path
.
exists
(
"../../Ontologies/"
+
file_name
+
"/"
)
==
False
):
os
.
mkdir
(
"../../Ontologies/"
+
file_name
)
os
.
mkdir
(
"../../Ontologies/"
+
file_name
)
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/requirements_views.py
View file @
08e9211f
...
@@ -80,6 +80,11 @@ class BoilerplateGroupDetailsAPIView(RetrieveUpdateDestroyAPIView):
...
@@ -80,6 +80,11 @@ class BoilerplateGroupDetailsAPIView(RetrieveUpdateDestroyAPIView):
serializer_class
=
BoilerplateGroupSerializer
serializer_class
=
BoilerplateGroupSerializer
queryset
=
BoilerplateGroup
.
objects
.
all
()
queryset
=
BoilerplateGroup
.
objects
.
all
()
def
get_queryset
(
self
):
group_pk
=
self
.
kwargs
[
'pk'
]
queryset_infer
=
BoilerplateGroup
.
objects
.
filter
(
id
=
group_pk
)
return
queryset_infer
#Custom actions when PUT
#Custom actions when PUT
def
perform_update
(
self
,
serializer
):
def
perform_update
(
self
,
serializer
):
instance
=
serializer
.
save
()
instance
=
serializer
.
save
()
...
@@ -177,6 +182,7 @@ class PrefixListAPIView(ListAPIView):
...
@@ -177,6 +182,7 @@ class PrefixListAPIView(ListAPIView):
class
ExtractedPropertyAPIView
(
APIView
):
class
ExtractedPropertyAPIView
(
APIView
):
def
get
(
self
,
request
,
groupboil
,
boilerplate
,
format
=
None
):
def
get
(
self
,
request
,
groupboil
,
boilerplate
,
format
=
None
):
return
Response
(
getExtractedProperty
(
boilerplate
))
return
Response
(
getExtractedProperty
(
boilerplate
))
...
@@ -279,11 +285,14 @@ class PropertyListAPIView(APIView):
...
@@ -279,11 +285,14 @@ class PropertyListAPIView(APIView):
"""
"""
API view to retrieve property file
API view to retrieve property file
"""
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
BoilerplateDataSerializer
serializer_class
=
BoilerplateDataSerializer
def
get
(
self
,
request
,
groupboil
,
format
=
None
):
def
get
(
self
,
request
,
groupboil
,
format
=
None
):
group_gb
=
groupboil
group_gb
=
groupboil
queryset_boil_data
=
BoilerplateData
.
objects
.
filter
(
owner_data
=
self
.
request
.
user
,
group_of_boilerplate_data
=
group_gb
)
#queryset_boil_data = BoilerplateData.objects.filter(owner_data = self.request.user, group_of_boilerplate_data = group_gb)
queryset_boil_data
=
BoilerplateData
.
objects
.
filter
(
group_of_boilerplate_data
=
group_gb
)
#temp_file = NamedTemporaryFile(delete=False)
#temp_file = NamedTemporaryFile(delete=False)
a
=
list
(
queryset_boil_data
.
values
())
a
=
list
(
queryset_boil_data
.
values
())
with
tempfile
.
NamedTemporaryFile
(
mode
=
'w+t'
,
delete
=
False
)
as
f
:
with
tempfile
.
NamedTemporaryFile
(
mode
=
'w+t'
,
delete
=
False
)
as
f
:
...
...
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