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
8aecd007
Commit
8aecd007
authored
Feb 01, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSONField
parent
76a7602c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
20 deletions
+29
-20
requirements.py
...ool/reqman/api/reqman/apps/reqtool/models/requirements.py
+5
-5
suffix_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/suffix_req.py
+9
-5
parse_ontologies.py
...reqman/apps/reqtool/rest_api/services/parse_ontologies.py
+1
-1
requirements_views.py
.../reqman/apps/reqtool/rest_api/views/requirements_views.py
+13
-9
dev.txt
reqtool/reqman/api/requirements/dev.txt
+1
-0
No files found.
reqtool/reqman/api/reqman/apps/reqtool/models/requirements.py
View file @
8aecd007
...
...
@@ -97,13 +97,13 @@ class Prefix(models.Model):
system_state
=
models
.
TextField
(
max_length
=
100
,
blank
=
True
)
state_value
=
models
.
TextField
(
max_length
=
100
,
blank
=
True
)
#occuring functionality
sys_fun
=
models
.
Text
Field
(
choices
=
SYSTEM_OR_FUNCTION_CHOICES
,
max_length
=
100
,
blank
=
True
)
verb
=
models
.
TextField
(
choices
=
VERB_CHOICES
,
max_length
=
100
,
blank
=
True
)
item_function_flow
=
models
.
Text
Field
(
choices
=
ITEM_FLOW_FUNCTION
,
max_length
=
100
,
blank
=
True
)
sys_fun
=
models
.
Char
Field
(
choices
=
SYSTEM_OR_FUNCTION_CHOICES
,
max_length
=
100
,
blank
=
True
)
verb
=
models
.
CharField
(
choices
=
VERB_CHOICES
,
max_length
=
100
,
blank
=
True
)
item_function_flow
=
models
.
Char
Field
(
choices
=
ITEM_FLOW_FUNCTION
,
max_length
=
100
,
blank
=
True
)
#Prefix value P1/P2/P3
logical_expression
=
models
.
CharField
(
choices
=
LOGICAL_EXPRESSION
,
max_length
=
100
)
logical_expression
=
models
.
CharField
(
choices
=
LOGICAL_EXPRESSION
,
max_length
=
100
,
blank
=
True
)
#add extra prefix
logic_connective
=
models
.
CharField
(
choices
=
LOGIC_CONNECTIVE
,
default
=
''
,
max_length
=
100
,
null
=
True
)
logic_connective
=
models
.
CharField
(
choices
=
LOGIC_CONNECTIVE
,
default
=
''
,
max_length
=
100
,
blank
=
True
)
simple_prefix
=
models
.
CharField
(
choices
=
SIMPLE_PREFIX_CHOICES
,
max_length
=
100
)
...
...
reqtool/reqman/api/reqman/apps/reqtool/models/suffix_req.py
View file @
8aecd007
from
django.db
import
models
from
reqman.apps.account.models
import
User
import
jsonfield
from
pygments.formatters.html
import
HtmlFormatter
from
pygments
import
highlight
...
...
@@ -47,15 +49,17 @@ class Suffix(models.Model):
boilerplate_of_suffix
=
models
.
ForeignKey
(
'reqtool.Boilerplate'
,
related_name
=
'suffix_boilerplate'
,
on_delete
=
models
.
CASCADE
)
suffix_owner
=
models
.
ForeignKey
(
User
,
related_name
=
'suffix_owner'
,
on_delete
=
models
.
CASCADE
)
#prefix templates
s_choices
=
models
.
CharField
(
choices
=
S_CHOICES
,
max_length
=
100
)
s_choices
=
models
.
CharField
(
choices
=
S_CHOICES
,
max_length
=
100
,
blank
=
True
)
#if S1
numerical
=
models
.
IntegerField
(
default
=
0
,
blank
=
True
)
mumerical_units
=
models
.
CharField
(
choices
=
NUMBER_UNITS_CHOICES
,
max_length
=
100
)
time_units
=
models
.
CharField
(
choices
=
TIME_UNITS_CHOICES
,
max_length
=
100
)
mumerical_units
=
models
.
CharField
(
choices
=
NUMBER_UNITS_CHOICES
,
max_length
=
100
,
blank
=
True
)
time_units
=
models
.
CharField
(
choices
=
TIME_UNITS_CHOICES
,
max_length
=
100
,
blank
=
True
)
#if S2/S3
flow
=
models
.
CharField
(
choices
=
FLOW_CHOICES
,
max_length
=
100
)
flow
=
models
.
CharField
(
choices
=
FLOW_CHOICES
,
max_length
=
100
,
blank
=
True
)
#find suffix
suffix_choices
=
models
.
CharField
(
choices
=
SUFFIX_CHOICES
,
max_length
=
100
)
suffix_choices
=
models
.
CharField
(
choices
=
SUFFIX_CHOICES
,
max_length
=
100
,
blank
=
True
)
#custom suffix
custom_suffix
=
jsonfield
.
JSONField
()
class
Meta
:
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/parse_ontologies.py
View file @
8aecd007
...
...
@@ -5,7 +5,7 @@
Ontology_file
=
"../../Ontologies/Mokos_18_1_7_47.ttl"
list_of_DSO
=
[
"DSO"
,
"DSO-AOCS"
,
"DSO-AOCS-instances"
]
list_of_RMO
=
[
"RMO"
,
"RMO-instances"
,
"DSO-AOCS-instances"
]
list_of_RMO
=
[
"RMO"
,
"RMO-instances"
,
"DSO-AOCS-instances"
,
"<http://delab.csd.auth.gr/ontologies/2018/RDO-instances"
]
'''Return the Systems and Items from the Ontologies'''
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/requirements_views.py
View file @
8aecd007
...
...
@@ -67,19 +67,11 @@ class PrefixListAPIView(ListAPIView):
queryset_prefix
=
Prefix
.
objects
.
filter
(
prefix_boilerplate
=
group_pk
)
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
PrefixDetailsAPIView
(
RetrieveUpdateDestroyAPIView
):
"""
API view to retrieve, update or delete post
"""
permission_classes
=
[
permissions
.
IsAuthenticatedOrReadOnly
]
serializer_class
=
PrefixSerializer
#queryset = Prefix.objects.all()
...
...
@@ -88,13 +80,25 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
queryset_prefix
=
Prefix
.
objects
.
filter
(
prefix_boilerplate
=
group_pk
)
return
queryset_prefix
def
simple_prefix
(
self
,
prefix
):
if
prefix
==
"If/Unless"
:
return
"P1"
if
prefix
==
"As soon as"
:
return
"P2"
if
prefix
==
"As long as"
:
return
"P3"
#Custom actions when PUT
def
perform_update
(
self
,
serializer
):
serializer
.
save
()
#print(self.new.changed_data)
instance
=
serializer
.
validated_data
sprefix
=
self
.
simple_prefix
(
instance
[
"prefix"
])
#instance = serializer.save()
#write_fuseki = fuseki.FusekiActions()
#write_fuseki.write(serializer.data)
serializer
.
save
(
simple_prefix
=
sprefix
)
#Custom actions when DELETE
def
perform_destroy
(
self
,
instance
):
...
...
reqtool/reqman/api/requirements/dev.txt
View file @
8aecd007
...
...
@@ -65,6 +65,7 @@ pillow==6.1.0
#Ontologies
rdflib==5.0.0
sparqlwrapper==1.8.5
django-jsonfield==1.4.1
# The following packages are considered to be unsafe in a requirements file:
...
...
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