From 482e0338311b883ac07784e4ccbaa03d5c8f399b Mon Sep 17 00:00:00 2001 From: root <Yorgo EL MOUBAYED> Date: Mon, 1 Mar 2021 07:36:18 +0100 Subject: [PATCH] New folders --- {mynewapi => dataproc}/__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin .../__pycache__/admin.cpython-38.pyc | Bin .../__pycache__/apps.cpython-38.pyc | Bin .../__pycache__/models.cpython-38.pyc | Bin {mynewapi => dataproc}/admin.py | 0 .../migrations => dataproc/api}/__init__.py | 0 dataproc/api/serializers.py | 8 + dataproc/api/urls.py | 16 ++ dataproc/api/views.py | 72 +++++++ dataproc/apps.py | 5 + {newapi => dataproc/migrations}/__init__.py | 0 .../migrations/models/report.py | 0 .../migrations/models/rsf.py | 0 dataproc/models.py | 179 ++++++++++++++++++ dataproc/settings.py | 133 +++++++++++++ dataproc/tests/__init.py__ | 0 dataproc/tests/test_forms.py | 0 dataproc/tests/test_models.py | 0 dataproc/tests/test_urls.py | 9 + dataproc/tests/test_views.py | 0 {mynewapi => dataproc}/views.py | 0 mynewapi/apps.py | 5 - mynewapi/models.py | 168 ---------------- mynewapi/tests.py | 3 - myservice/__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin .../__pycache__/settings.cpython-38.pyc | Bin .../__pycache__/urls.cpython-38.pyc | Bin {newapi => myservice}/asgi.py | 0 {newapi => myservice}/settings.py | 9 +- {newapi => myservice}/urls.py | 0 {newapi => myservice}/wsgi.py | 0 33 files changed, 429 insertions(+), 178 deletions(-) rename {mynewapi => dataproc}/__init__.py (100%) rename {mynewapi => dataproc}/__pycache__/__init__.cpython-38.pyc (100%) rename {mynewapi => dataproc}/__pycache__/admin.cpython-38.pyc (100%) rename {mynewapi => dataproc}/__pycache__/apps.cpython-38.pyc (100%) rename {mynewapi => dataproc}/__pycache__/models.cpython-38.pyc (100%) rename {mynewapi => dataproc}/admin.py (100%) rename {mynewapi/migrations => dataproc/api}/__init__.py (100%) create mode 100644 dataproc/api/serializers.py create mode 100644 dataproc/api/urls.py create mode 100644 dataproc/api/views.py create mode 100644 dataproc/apps.py rename {newapi => dataproc/migrations}/__init__.py (100%) rename {mynewapi => dataproc}/migrations/models/report.py (100%) rename {mynewapi => dataproc}/migrations/models/rsf.py (100%) create mode 100644 dataproc/models.py create mode 100644 dataproc/settings.py create mode 100644 dataproc/tests/__init.py__ create mode 100644 dataproc/tests/test_forms.py create mode 100644 dataproc/tests/test_models.py create mode 100644 dataproc/tests/test_urls.py create mode 100644 dataproc/tests/test_views.py rename {mynewapi => dataproc}/views.py (100%) delete mode 100644 mynewapi/apps.py delete mode 100644 mynewapi/models.py delete mode 100644 mynewapi/tests.py create mode 100644 myservice/__init__.py rename {newapi => myservice}/__pycache__/__init__.cpython-38.pyc (100%) rename {newapi => myservice}/__pycache__/settings.cpython-38.pyc (100%) rename {newapi => myservice}/__pycache__/urls.cpython-38.pyc (100%) rename {newapi => myservice}/asgi.py (100%) rename {newapi => myservice}/settings.py (97%) rename {newapi => myservice}/urls.py (100%) rename {newapi => myservice}/wsgi.py (100%) diff --git a/mynewapi/__init__.py b/dataproc/__init__.py similarity index 100% rename from mynewapi/__init__.py rename to dataproc/__init__.py diff --git a/mynewapi/__pycache__/__init__.cpython-38.pyc b/dataproc/__pycache__/__init__.cpython-38.pyc similarity index 100% rename from mynewapi/__pycache__/__init__.cpython-38.pyc rename to dataproc/__pycache__/__init__.cpython-38.pyc diff --git a/mynewapi/__pycache__/admin.cpython-38.pyc b/dataproc/__pycache__/admin.cpython-38.pyc similarity index 100% rename from mynewapi/__pycache__/admin.cpython-38.pyc rename to dataproc/__pycache__/admin.cpython-38.pyc diff --git a/mynewapi/__pycache__/apps.cpython-38.pyc b/dataproc/__pycache__/apps.cpython-38.pyc similarity index 100% rename from mynewapi/__pycache__/apps.cpython-38.pyc rename to dataproc/__pycache__/apps.cpython-38.pyc diff --git a/mynewapi/__pycache__/models.cpython-38.pyc b/dataproc/__pycache__/models.cpython-38.pyc similarity index 100% rename from mynewapi/__pycache__/models.cpython-38.pyc rename to dataproc/__pycache__/models.cpython-38.pyc diff --git a/mynewapi/admin.py b/dataproc/admin.py similarity index 100% rename from mynewapi/admin.py rename to dataproc/admin.py diff --git a/mynewapi/migrations/__init__.py b/dataproc/api/__init__.py similarity index 100% rename from mynewapi/migrations/__init__.py rename to dataproc/api/__init__.py diff --git a/dataproc/api/serializers.py b/dataproc/api/serializers.py new file mode 100644 index 0000000..b78cb10 --- /dev/null +++ b/dataproc/api/serializers.py @@ -0,0 +1,8 @@ +from rest_framework import serializers +from dataproc.models import Contruct + + +class ContructSerializer(serializers.ModelSerializer): + class Meta: + model = Contruct + fields = ['title', 'created_at', 'updated_at',] \ No newline at end of file diff --git a/dataproc/api/urls.py b/dataproc/api/urls.py new file mode 100644 index 0000000..29c1718 --- /dev/null +++ b/dataproc/api/urls.py @@ -0,0 +1,16 @@ +from django.urls import path +from dataproc.api.views import( + api_detail_construct_view, + api_update_construct_view, + api_delete_construct_view, + api_create_construct_view, +) + +app_name = 'dataproc' + +urlpatterns = [ + path('<slug>/', api_detail_construct_view, name="detail"), + path('<slug>/update', api_update_construct_view, name="update"), + path('<slug>/delete', api_delete_construct_view, name="delete"), + path('create', api_create_construct_view, name="create"), +] \ No newline at end of file diff --git a/dataproc/api/views.py b/dataproc/api/views.py new file mode 100644 index 0000000..b36507b --- /dev/null +++ b/dataproc/api/views.py @@ -0,0 +1,72 @@ +from rest_framework import status +from rest_framework.response import Response +from rest_framework.decorators import api_view + +from dataproc.models import Construct +from dataproc.api.serializers import ConstructSerializer + +SUCCESS = 'success' +ERROR = 'error' +DELETE_SUCCESS = 'deleted' +UPDATE_SUCCESS = 'updated' +CREATE_SUCCESS = 'created' + +@api_view(['GET', ]) +def api_detail_construct_view(request, slug): + + try: + construct = Construct.objects.get(slug=slug) + except Construct.DoesNotExist: + return Response(status=status.HTTP_404_NOT_FOUND) + + if request.method == 'GET': + serializer = ConstructSerializer(blog_post) + return Response(serializer.data) + + +@api_view(['PUT',]) +def api_update_construct_view(request, slug): + + try: + construct = Construct.objects.get(slug=slug) + except Construct.DoesNotExist: + return Response(status=status.HTTP_404_NOT_FOUND) + + if request.method == 'PUT': + serializer = ConstructSerializer(construct, data=request.data) + data = {} + if serializer.is_valid(): + serializer.save() + data['SUCCESS'] = UPDATE_SUCCESS + return Response(data=data) + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + +@api_view(['DELETE',]) +def api_delete_blog_view(request, slug): + + try: + construct = Construct.objects.get(slug=slug) + except Construct.DoesNotExist: + return Response(status=status.HTTP_404_NOT_FOUND) + + if request.method == 'DELETE': + operation = construct.delete() + data = {} + if operation: + data['SUCCESS'] = DELETE_SUCCESS + return Response(data=data) + + +@api_view(['POST']) +def api_create_construct_view(request): + + construct = Construct() + + if request.method == 'POST': + serializer = ConstructSerializer(construct, data=request.data) + data = {} + if serializer.is_valid(): + serializer.save() + return Response(serializer.data, status=status.HTTP_201_CREATED) + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) \ No newline at end of file diff --git a/dataproc/apps.py b/dataproc/apps.py new file mode 100644 index 0000000..f1cf212 --- /dev/null +++ b/dataproc/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class apiConfig(AppConfig): + name = 'api' diff --git a/newapi/__init__.py b/dataproc/migrations/__init__.py similarity index 100% rename from newapi/__init__.py rename to dataproc/migrations/__init__.py diff --git a/mynewapi/migrations/models/report.py b/dataproc/migrations/models/report.py similarity index 100% rename from mynewapi/migrations/models/report.py rename to dataproc/migrations/models/report.py diff --git a/mynewapi/migrations/models/rsf.py b/dataproc/migrations/models/rsf.py similarity index 100% rename from mynewapi/migrations/models/rsf.py rename to dataproc/migrations/models/rsf.py diff --git a/dataproc/models.py b/dataproc/models.py new file mode 100644 index 0000000..e351f71 --- /dev/null +++ b/dataproc/models.py @@ -0,0 +1,179 @@ +# from django.db import models +# from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo, DateTimeProperty, BooleanProperty + +# class City(StructuredNode): +# code = StringProperty(unique_index=True, required=True) +# name = StringProperty(index=True, default="city") + +from django.db import models +from django.utils.text import slugify +from django.conf import settings + +class Contruct(models.Model): + title = models.CharField(max_length=50, null=False, blank=True) + created_at = models.DateTimeField(auto_now_add=True, verbose_name="created at") + updated_at = models.DateTimeField(auto_now=True, verbose_name="updated at") + slug = models.SlugField(blank=True, unique=True) + + def __str__(self): + return self.title + +##################################### +# Nodes and properties of the model # +##################################### + +# class LigandsFitting(StructuredNode): +# uid=UniqueIdProperty() +# dp_step_name = StringProperty() +# created_at=DateTimeProperty() +# updated_at=DateTimeProperty() +# pipedream_id=IntegerProperty() +# score=IntegerProperty() +# fitting_success=BooleanProperty() + +# class Refinement(StructuredNode): +# uid=UniqueIdProperty() +# dp_step_name=StringProperty() +# created_at=DateTimeProperty() +# updated_at=DateTimeProperty() + +# class PostRefinement(StructuredNode): +# uid=UniqueIdProperty() +# dp_step_name=StringProperty() +# pipedream_id=IntegerProperty() +# created_at=DateTimeProperty() +# updated_at=DateTimeProperty() + +# class ReductionScaling(StructuredNode): +# uid=UniqueIdProperty() +# dp_step_name=StringProperty() +# created_at=DateTimeProperty() +# updated_at=DateTimeProperty() + +# class autoPROC(StructuredNode): +# uid=UniqueIdProperty() +# tool_name=StringProperty() + +# class Buster(StructuredNode): +# uid=UniqueIdProperty() +# tool_name=StringProperty() + +# class Rhofit(StructuredNode): +# uid=UniqueIdProperty() +# tool_name=StringProperty() + +# class StatisticalReport(StructuredNode): +# uid=UniqueIdProperty() +# report_name=StringProperty() + +# class ComputingHost(StructuredNode): +# ch_softwares=StringProperty() +# ch_softwares_number=IntegerProperty() + +# class StorageHost(StructuredNode): +# sh_files=StringProperty() +# sh_files_number=IntegerProperty() + +# class Report(StructuredNode): +# report_path=StringProperty() +# report_source=StringProperty() +# report_size=StringProperty() + +# # Relationships +# is_statisticalreport=RelationshipTo(StatisticalReport, 'IS') + +# class RefelctionStructureFactors(StructuredNode): +# rsf_source=StringProperty() +# rsf_filesize=StringProperty() +# rsf_filepath=StringProperty() + +# # Relationships +# input_as_ref=RelationshipTo(DPStep, 'INPUT_AS_REFERENCE') +# input_of=RelationshipTo(DPStep, 'INPUT') +# generates_mtz=RelationshipTo(MTZfile, 'GENERATES') +# generates_scalepack=RelationshipTo(ScalepackFile, 'GENERATES') +# labelled=RelationshipTo(Reference, 'LABELLED') +# belongs=RelationshipTo(Construct, 'BELONGS') + +# class DPStep(StructuredNode): + +# # Relationships +# is_fitting=RelationshipTo(LigandsFitting, 'IS') +# is_refinement=RelationshipTo(Refinement, 'IS') +# is_postrefinement=RelationshipTo(PostRefinement, 'IS') +# is_reductionscaling=RelationshipTo(ReductionScaling, 'IS') +# with_tool_1=RelationshipTo(autoPROC, 'WITH') +# with_tool_2=RelationshipTo(Rhofit, 'WITH') +# with_tool_3=RelationshipTo(Buster, 'WITH') +# genereates_report=RelationshipTo(Report, 'GENERATES') +# # generates_coordinates=RelationshipTo(Coordinates, 'GENERATES') +# generates_rsf=RelationshipTo(RefelctionStructureFactors, 'GENERATES') + +# class Coordinates(StructuredNode): +# coordinates_source=StringProperty(unique_index=True, required=True) +# coordinates_filesize=StringProperty(unique_index=True, required=True) +# coordinates_filepath=StringProperty(unique_index=True, required=True) + +# # Relationships +# input_as_ref=RelationshipTo(DPStep, 'INPUT_AS_REFERENCE') +# input_of=RelationshipTo(DPStep, 'INPUT') +# has_pdb=RelationshipTo(PDBFile, 'HAS') +# has_mmcif=RelationshipTo(mmCIFFile, 'HAS') +# belongs=RelationshipTo(Construct, 'BELONGS') +# labelled=RelationshipTo(Reference, 'LABELLED') + + +# class DataCollection (StructuredNode): +# collection_type=StringProperty() +# collection_size=StringProperty() + +# # Relationships +# genereates_dataset=RelationshipTo(Datatset, 'GENERATES') + +# class Datatset(StructuredNode): +# dataset_file_no=IntegerProperty() +# dataset_size=StringProperty() + +# # Relationships +# input_of=RelationshipTo(DPStep, 'INPUT') +# stored=RelationshipTo(StorageHost, 'STORED') +# belongs=RelationshipTo(Construct, 'BELONGS') + +# class mmCIFFile(StructuredNode): +# uid=UniqueIdProperty() +# coordinates_filetype=StringProperty(unique_index=True, required=True) + +# class PDBFile(StructuredNode): +# uid=UniqueIdProperty() +# coordinates_filetype=StringProperty(unique_index=True, required=True) + +# class MTZfile(StructuredNode): +# uid=UniqueIdProperty() +# rsf_filetype = StringProperty(unique_index=True, required=True) + +# class ScalepackFile(StructuredNode): +# uid=UniqueIdProperty() +# rsf_filetype = StringProperty(unique_index=True, required=True) + +# class Reference(StructuredNode): +# uid=UniqueIdProperty() + +# class OCF(StructuredNode): + +# # Relationships +# has_rsf=RelationshipTo(RefelctionStructureFactors, 'HAS') +# has_coordinates=RelationshipTo(Coordinates, 'HAS') + +# class Construct(StructuredNode): + +# # Relationships +# has_ocf=RelationshipTo(OCF, 'HAS') +# has_storage_host=RelationshipTo(StorageHost, 'HAS') +# has_computing_host=RelationshipTo(ComputingHost, 'HAS') + + +# class Ligand(StructuredNode): + +# # Relationships +# associated=RelationshipTo(Datatset, 'ASSOCIATED') + diff --git a/dataproc/settings.py b/dataproc/settings.py new file mode 100644 index 0000000..e58a414 --- /dev/null +++ b/dataproc/settings.py @@ -0,0 +1,133 @@ +""" +Django settings for newapi project. + +Generated by 'django-admin startproject' using Django 3.1.6. + +For more information on this file, see +https://docs.djangoproject.com/en/3.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.1/ref/settings/ +""" + +from pathlib import Path +import os +from decouple import config + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '=013nqbp3o8hr9e*it$b1um^%ke*uxqvt5qnp=xe6@^20a)d!b' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + + #django apps + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django_neomodel' + 'rest_framework' + + + #My apps + 'dataproc', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'newapi.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'newapi.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + +NEOMODEL_NEO4J_BOLT_URL = os.environ.get('NEO4J_BOLT_URL','bolt://neo4j:neo4@localhost:7687') + + + +# Password validation +# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.1/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/dataproc/tests/__init.py__ b/dataproc/tests/__init.py__ new file mode 100644 index 0000000..e69de29 diff --git a/dataproc/tests/test_forms.py b/dataproc/tests/test_forms.py new file mode 100644 index 0000000..e69de29 diff --git a/dataproc/tests/test_models.py b/dataproc/tests/test_models.py new file mode 100644 index 0000000..e69de29 diff --git a/dataproc/tests/test_urls.py b/dataproc/tests/test_urls.py new file mode 100644 index 0000000..a6ef7fa --- /dev/null +++ b/dataproc/tests/test_urls.py @@ -0,0 +1,9 @@ +from django.test import SimpleTestCase +from django.urls import reverse, resolve + +class TestUrls(SimpleTestCase): + + def {test_url}(self): + url = reverse('{url_route}') + self.assertEquals(resolve(url).func, ) + diff --git a/dataproc/tests/test_views.py b/dataproc/tests/test_views.py new file mode 100644 index 0000000..e69de29 diff --git a/mynewapi/views.py b/dataproc/views.py similarity index 100% rename from mynewapi/views.py rename to dataproc/views.py diff --git a/mynewapi/apps.py b/mynewapi/apps.py deleted file mode 100644 index b0e511d..0000000 --- a/mynewapi/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class MynewapiConfig(AppConfig): - name = 'mynewapi' diff --git a/mynewapi/models.py b/mynewapi/models.py deleted file mode 100644 index f772575..0000000 --- a/mynewapi/models.py +++ /dev/null @@ -1,168 +0,0 @@ -from django.db import models -from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo, DateTimeProperty, BooleanProperty - -# class City(StructuredNode): -# code = StringProperty(unique_index=True, required=True) -# name = StringProperty(index=True, default="city") - -##################################### -# Nodes and properties of the model # -##################################### - -class LigandsFitting(StructuredNode): - uid=UniqueIdProperty() - dp_step_name = StringProperty() - created_at=DateTimeProperty() - updated_at=DateTimeProperty() - pipedream_id=IntegerProperty() - score=IntegerProperty() - fitting_success=BooleanProperty() - -class Refinement(StructuredNode): - uid=UniqueIdProperty() - dp_step_name=StringProperty() - created_at=DateTimeProperty() - updated_at=DateTimeProperty() - -class PostRefinement(StructuredNode): - uid=UniqueIdProperty() - dp_step_name=StringProperty() - pipedream_id=IntegerProperty() - created_at=DateTimeProperty() - updated_at=DateTimeProperty() - -class ReductionScaling(StructuredNode): - uid=UniqueIdProperty() - dp_step_name=StringProperty() - created_at=DateTimeProperty() - updated_at=DateTimeProperty() - -class autoPROC(StructuredNode): - uid=UniqueIdProperty() - tool_name=StringProperty() - -class Buster(StructuredNode): - uid=UniqueIdProperty() - tool_name=StringProperty() - -class Rhofit(StructuredNode): - uid=UniqueIdProperty() - tool_name=StringProperty() - -class StatisticalReport(StructuredNode): - uid=UniqueIdProperty() - report_name=StringProperty() - -class ComputingHost(StructuredNode): - ch_softwares=StringProperty() - ch_softwares_number=IntegerProperty() - -class StorageHost(StructuredNode): - sh_files=StringProperty() - sh_files_number=IntegerProperty() - -########################################################################## - -class Report(StructuredNode): - report_path=StringProperty() - report_source=StringProperty() - report_size=StringProperty() - - # Relationships - is_statisticalreport=RelationshipTo(StatisticalReport, 'IS') - -class RefelctionStructureFactors(StructuredNode): - rsf_source=StringProperty() - rsf_filesize=StringProperty() - rsf_filepath=StringProperty() - - # Relationships - input_as_ref=RelationshipTo(DPStep, 'INPUT_AS_REFERENCE') - input_of=RelationshipTo(DPStep, 'INPUT') - generates_mtz=RelationshipTo(MTZfile, 'GENERATES') - generates_scalepack=RelationshipTo(ScalepackFile, 'GENERATES') - labelled=RelationshipTo(Reference, 'LABELLED') - belongs=RelationshipTo(Construct, 'BELONGS') - -class DPStep(StructuredNode): - - # Relationships - is_fitting=RelationshipTo(LigandsFitting, 'IS') - is_refinement=RelationshipTo(Refinement, 'IS') - is_postrefinement=RelationshipTo(PostRefinement, 'IS') - is_reductionscaling=RelationshipTo(ReductionScaling, 'IS') - with_tool_1=RelationshipTo(autoPROC, 'WITH') - with_tool_2=RelationshipTo(Rhofit, 'WITH') - with_tool_3=RelationshipTo(Buster, 'WITH') - genereates_report=RelationshipTo(Report, 'GENERATES') - # generates_coordinates=RelationshipTo(Coordinates, 'GENERATES') - generates_rsf=RelationshipTo(RefelctionStructureFactors, 'GENERATES') - -class Coordinates(StructuredNode): - coordinates_source=StringProperty(unique_index=True, required=True) - coordinates_filesize=StringProperty(unique_index=True, required=True) - coordinates_filepath=StringProperty(unique_index=True, required=True) - - # Relationships - input_as_ref=RelationshipTo(DPStep, 'INPUT_AS_REFERENCE') - input_of=RelationshipTo(DPStep, 'INPUT') - has_pdb=RelationshipTo(PDBFile, 'HAS') - has_mmcif=RelationshipTo(mmCIFFile, 'HAS') - belongs=RelationshipTo(Construct, 'BELONGS') - labelled=RelationshipTo(Reference, 'LABELLED') - - -class DataCollection (StructuredNode): - collection_type=StringProperty() - collection_size=StringProperty() - - # Relationships - genereates_dataset=RelationshipTo(Datatset, 'GENERATES') - -class Datatset(StructuredNode): - dataset_file_no=IntegerProperty() - dataset_size=StringProperty() - - # Relationships - input_of=RelationshipTo(DPStep, 'INPUT') - stored=RelationshipTo(StorageHost, 'STORED') - belongs=RelationshipTo(Construct, 'BELONGS') - -class mmCIFFile(StructuredNode): - uid=UniqueIdProperty() - coordinates_filetype=StringProperty(unique_index=True, required=True) - -class PDBFile(StructuredNode): - uid=UniqueIdProperty() - coordinates_filetype=StringProperty(unique_index=True, required=True) - -class MTZfile(StructuredNode): - uid=UniqueIdProperty() - rsf_filetype = StringProperty(unique_index=True, required=True) - -class ScalepackFile(StructuredNode): - uid=UniqueIdProperty() - rsf_filetype = StringProperty(unique_index=True, required=True) - -class Reference(StructuredNode): - uid=UniqueIdProperty() - -class OCF(StructuredNode): - - # Relationships - has_rsf=RelationshipTo(RefelctionStructureFactors, 'HAS') - has_coordinates=RelationshipTo(Coordinates, 'HAS') - -class Construct(StructuredNode): - - # Relationships - has_ocf=RelationshipTo(OCF, 'HAS') - has_storage_host=RelationshipTo(StorageHost, 'HAS') - has_computing_host=RelationshipTo(ComputingHost, 'HAS') - - -class Ligand(StructuredNode): - - # Relationships - associated=RelationshipTo(Datatset, 'ASSOCIATED') - diff --git a/mynewapi/tests.py b/mynewapi/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/mynewapi/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/myservice/__init__.py b/myservice/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/newapi/__pycache__/__init__.cpython-38.pyc b/myservice/__pycache__/__init__.cpython-38.pyc similarity index 100% rename from newapi/__pycache__/__init__.cpython-38.pyc rename to myservice/__pycache__/__init__.cpython-38.pyc diff --git a/newapi/__pycache__/settings.cpython-38.pyc b/myservice/__pycache__/settings.cpython-38.pyc similarity index 100% rename from newapi/__pycache__/settings.cpython-38.pyc rename to myservice/__pycache__/settings.cpython-38.pyc diff --git a/newapi/__pycache__/urls.cpython-38.pyc b/myservice/__pycache__/urls.cpython-38.pyc similarity index 100% rename from newapi/__pycache__/urls.cpython-38.pyc rename to myservice/__pycache__/urls.cpython-38.pyc diff --git a/newapi/asgi.py b/myservice/asgi.py similarity index 100% rename from newapi/asgi.py rename to myservice/asgi.py diff --git a/newapi/settings.py b/myservice/settings.py similarity index 97% rename from newapi/settings.py rename to myservice/settings.py index bc05626..bb06d0e 100644 --- a/newapi/settings.py +++ b/myservice/settings.py @@ -32,15 +32,20 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ + + #django apps 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - - 'mynewapi.apps.MynewapiConfig', 'django_neomodel' + 'rest_framework' + + + #My apps + 'api.apps.apiConfig', ] MIDDLEWARE = [ diff --git a/newapi/urls.py b/myservice/urls.py similarity index 100% rename from newapi/urls.py rename to myservice/urls.py diff --git a/newapi/wsgi.py b/myservice/wsgi.py similarity index 100% rename from newapi/wsgi.py rename to myservice/wsgi.py -- GitLab