Commit 887d0dc7 authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

add S1-S6, change view list

parent d8af2e11
{
"python.pythonPath": "/home/nestorid/.pyenv/versions/reqman/bin/python"
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ from django.db import models
#from reqman.apps.common.models import CoreModel
from reqman.apps.account.models import User
from reqman.apps.reqtool.models.main_req import create_main
from reqman.apps.reqtool.models.suffix_req import create_suffix
from pygments.formatters.html import HtmlFormatter
from pygments import highlight
......@@ -37,11 +38,6 @@ def create_prefix(instance):
prefix.save()
def create_suffix(instance):
'''Create the Suffix Model for the Boilerplate'''
pass
def create_p1(instance, now_prefix, prev_prefix, series_of_prefix):
try :
prefix = LogicalExpression.objects.get(prefix = instance, prefix_boilerplate = instance.boilerplate, prefix_series = series_of_prefix)
......@@ -136,6 +132,7 @@ class Boilerplate(models.Model):
super(Boilerplate, self).save(**kwargs)
create_prefix(self)
create_main(self)
create_suffix(self)
class Meta:
......
This diff is collapsed.
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
class SuffixSerializer(serializers.ModelSerializer):
boilerplate_of_suffix = serializers.PrimaryKeyRelatedField(read_only=True)
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')
......@@ -3,8 +3,8 @@ from reqman.apps.account.models import User
from reqman.apps.reqtool.models.requirements import Boilerplate
class UserSerializer(serializers.ModelSerializer):
boilerplates = serializers.PrimaryKeyRelatedField(many=True, queryset=Boilerplate.objects.all())
#boilerplates = serializers.PrimaryKeyRelatedField(many=True, queryset=Boilerplate.objects.all())
class Meta:
model = User
fields = ['pk', 'first_name', 'last_name', 'email', 'boilerplates']
\ No newline at end of file
fields = ['pk', 'first_name', 'last_name', 'email' ]#, 'boilerplates']
\ No newline at end of file
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.generics import ListAPIView, RetrieveUpdateDestroyAPIView, ListAPIView
from rest_framework import permissions
from django.http import HttpResponse, JsonResponse
......@@ -18,7 +18,7 @@ from reqman.apps.reqtool.rest_api.serializers.main_req import Main_M13Serializer
from reqman.apps.permissions import IsOwnerOrReadOnly
from reqman.apps.reqtool.rest_api.services import fuseki
class MainListCreateAPIView(ListCreateAPIView):
class MainListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -68,7 +68,7 @@ class MainDetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M1ListCreateAPIView(ListCreateAPIView):
class Main_M1ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -117,7 +117,7 @@ class Main_M1DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M2ListCreateAPIView(ListCreateAPIView):
class Main_M2ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -166,7 +166,7 @@ class Main_M2DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M3ListCreateAPIView(ListCreateAPIView):
class Main_M3ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -215,7 +215,7 @@ class Main_M3DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M4ListCreateAPIView(ListCreateAPIView):
class Main_M4ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -264,7 +264,7 @@ class Main_M4DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M5ListCreateAPIView(ListCreateAPIView):
class Main_M5ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -313,7 +313,7 @@ class Main_M5DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M6ListCreateAPIView(ListCreateAPIView):
class Main_M6ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -362,7 +362,7 @@ class Main_M6DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M7ListCreateAPIView(ListCreateAPIView):
class Main_M7ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -411,7 +411,7 @@ class Main_M7DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M8ListCreateAPIView(ListCreateAPIView):
class Main_M8ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -460,7 +460,7 @@ class Main_M8DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M9ListCreateAPIView(ListCreateAPIView):
class Main_M9ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -509,7 +509,7 @@ class Main_M9DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M10ListCreateAPIView(ListCreateAPIView):
class Main_M10ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -558,7 +558,7 @@ class Main_M10DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M11ListCreateAPIView(ListCreateAPIView):
class Main_M11ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -607,7 +607,7 @@ class Main_M11DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M12ListCreateAPIView(ListCreateAPIView):
class Main_M12ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -656,7 +656,7 @@ class Main_M12DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M13ListCreateAPIView(ListCreateAPIView):
class Main_M13ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -705,7 +705,7 @@ class Main_M13DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M14ListCreateAPIView(ListCreateAPIView):
class Main_M14ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -754,7 +754,7 @@ class Main_M14DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M15ListCreateAPIView(ListCreateAPIView):
class Main_M15ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -803,7 +803,7 @@ class Main_M15DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class Main_M16ListCreateAPIView(ListCreateAPIView):
class Main_M16ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView, ListAPIView
from rest_framework import permissions
from django.http import HttpResponse, JsonResponse
......@@ -52,7 +52,7 @@ class BoilerplateDetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class PrefixListCreateAPIView(ListCreateAPIView):
class PrefixListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -103,7 +103,7 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class LogicalExpressionListCreateAPIView(ListCreateAPIView):
class LogicalExpressionListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -145,7 +145,7 @@ class LogicalExpressionDetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class OccuringFunctionalityP2ListCreateAPIView(ListCreateAPIView):
class OccuringFunctionalityP2ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -189,7 +189,7 @@ class OccuringFunctionalityP2DetailsAPIView(RetrieveUpdateDestroyAPIView):
class OccuringFunctionalityP3ListCreateAPIView(ListCreateAPIView):
class OccuringFunctionalityP3ListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -232,7 +232,7 @@ class OccuringFunctionalityP3DetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class StateValueConstraintListCreateAPIView(ListCreateAPIView):
class StateValueConstraintListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......@@ -274,7 +274,7 @@ class StateValueConstraintDetailsAPIView(RetrieveUpdateDestroyAPIView):
instance.delete()
class OccuringFunctionalityForLogicalExpressionListCreateAPIView(ListCreateAPIView):
class OccuringFunctionalityForLogicalExpressionListAPIView(ListAPIView):
"""
API view to retrieve list of posts or create new
"""
......
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