diff --git a/dataproc/api/models/__pycache__/construct_model.cpython-38.pyc b/dataproc/api/models/__pycache__/construct_model.cpython-38.pyc index 017711cdc0d89b74d0388696f01015630d9989e2..43dd214258a3c16413b75b60c08036b534972863 100644 Binary files a/dataproc/api/models/__pycache__/construct_model.cpython-38.pyc and b/dataproc/api/models/__pycache__/construct_model.cpython-38.pyc differ diff --git a/dataproc/api/models/__pycache__/user_model.cpython-38.pyc b/dataproc/api/models/__pycache__/user_model.cpython-38.pyc index 124c1d3eeb4eb349b4bf0215342c8e3dd41b4d14..dcd7a1fa2a5db9ccec1eb8ee6344ebb61cd94714 100644 Binary files a/dataproc/api/models/__pycache__/user_model.cpython-38.pyc and b/dataproc/api/models/__pycache__/user_model.cpython-38.pyc differ diff --git a/dataproc/api/models/autoPROC_model.py b/dataproc/api/models/autoPROC_model.py index fb6019877691fda4aeb0cfd025217ff59541a8ae..49db05090ad1b80c2c4e3b69f76d6b84052d55c3 100644 --- a/dataproc/api/models/autoPROC_model.py +++ b/dataproc/api/models/autoPROC_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class autoPROC(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) tool_name=StringProperty() \ No newline at end of file diff --git a/dataproc/api/models/buster_model.py b/dataproc/api/models/buster_model.py index 82ae0be287de0ba9ab565387fc57cbee2fc9c861..7ffec8e666e61c32e00fdb6b087263e537942d95 100644 --- a/dataproc/api/models/buster_model.py +++ b/dataproc/api/models/buster_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class Buster(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) tool_name=StringProperty() \ No newline at end of file diff --git a/dataproc/api/models/construct_model.py b/dataproc/api/models/construct_model.py index a30b07697eaf1ef22694c3d3d59a5da5ec2902da..34141f156df5a27ba3483e476b4abb5de1a89a54 100644 --- a/dataproc/api/models/construct_model.py +++ b/dataproc/api/models/construct_model.py @@ -1,4 +1,5 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 # from api.models.ocf_model import OCF # from api.models.storagehost_model import StorageHost @@ -7,7 +8,7 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdPro class Construct(StructuredNode): - uuid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) name=StringProperty() # Relationships diff --git a/dataproc/api/models/coordinates_model.py b/dataproc/api/models/coordinates_model.py index c2bf7453b6efe1210c83079fa8c2df939df21f4c..19b910c1ecb490b5105a45282b46d6878c19d55c 100644 --- a/dataproc/api/models/coordinates_model.py +++ b/dataproc/api/models/coordinates_model.py @@ -7,8 +7,8 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdPro 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) + coordinates_filesize=StringProperty() + coordinates_filepath=StringProperty() # Relationships input_as_ref=RelationshipTo('api.models.dpstep_model.DPStep', 'INPUT_AS_REFERENCE') diff --git a/dataproc/api/models/ligandsfitting_model.py b/dataproc/api/models/ligandsfitting_model.py index ef56a15087622333ae2284ee755fe0cf1bb18422..796c5d35d7df0766571d18718487cf883cb1eab4 100644 --- a/dataproc/api/models/ligandsfitting_model.py +++ b/dataproc/api/models/ligandsfitting_model.py @@ -1,7 +1,8 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo, DateTimeProperty, BooleanProperty +from uuid import uuid4 class LigandsFitting(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) dp_step_name = StringProperty() created_at=DateTimeProperty() updated_at=DateTimeProperty() diff --git a/dataproc/api/models/mmciffile_model.py b/dataproc/api/models/mmciffile_model.py index b58468dc2103d4f073d173bc9ba7b210304a373f..c6e6f40768996187e0e6e51189a73a9421ee6821 100644 --- a/dataproc/api/models/mmciffile_model.py +++ b/dataproc/api/models/mmciffile_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class mmCIFFile(StructuredNode): - uid=UniqueIdProperty() - coordinates_filetype=StringProperty(unique_index=True, required=True) \ No newline at end of file + uuid=StringProperty(unique_index=True, default=uuid4) + coordinates_filetype=StringProperty() \ No newline at end of file diff --git a/dataproc/api/models/mtzfile_model.py b/dataproc/api/models/mtzfile_model.py index 35ff5b0b0caed5ee83fc9b4d1df9b1312b2036a9..1b1a356415069296de6352a5d1c9258e6daf8996 100644 --- a/dataproc/api/models/mtzfile_model.py +++ b/dataproc/api/models/mtzfile_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class MTZfile(StructuredNode): - uid=UniqueIdProperty() - rsf_filetype = StringProperty(unique_index=True, required=True) + uuid=StringProperty(unique_index=True, default=uuid4) + rsf_filetype = StringProperty() diff --git a/dataproc/api/models/pdbfile_model.py b/dataproc/api/models/pdbfile_model.py index 1efa8c7804afb967656d08522c23c52ec93c4f81..4ee6712e790dde3d911a0600b2925836eeeec6de 100644 --- a/dataproc/api/models/pdbfile_model.py +++ b/dataproc/api/models/pdbfile_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class PDBFile(StructuredNode): - uid=UniqueIdProperty() - coordinates_filetype=StringProperty(unique_index=True, required=True) \ No newline at end of file + uuid=StringProperty(unique_index=True, default=uuid4) + coordinates_filetype=StringProperty() \ No newline at end of file diff --git a/dataproc/api/models/postrefinement_model.py b/dataproc/api/models/postrefinement_model.py index c6f16e46c6c473068411706b6b203c4c83645ef3..08a078bf5d2f645fdc8064cb4a0b34c8ef300f49 100644 --- a/dataproc/api/models/postrefinement_model.py +++ b/dataproc/api/models/postrefinement_model.py @@ -1,7 +1,8 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo, DateTimeProperty +from uuid import uuid4 class PostRefinement(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) dp_step_name=StringProperty() pipedream_id=IntegerProperty() created_at=DateTimeProperty() diff --git a/dataproc/api/models/reductionscaling_model.py b/dataproc/api/models/reductionscaling_model.py index dbab87c2a4828d0679d6ace34f9a0460e84c8853..21a5d60226d32879397b98f45e08478a656ece1e 100644 --- a/dataproc/api/models/reductionscaling_model.py +++ b/dataproc/api/models/reductionscaling_model.py @@ -1,7 +1,8 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo, DateTimeProperty +from uuid import uuid4 class ReductionScaling(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) dp_step_name=StringProperty() created_at=DateTimeProperty() updated_at=DateTimeProperty() \ No newline at end of file diff --git a/dataproc/api/models/reference_model.py b/dataproc/api/models/reference_model.py index 7ba8afb7a239e3be2d6bdfb6e7a9bd69e845e6d8..f092588229c7d4f70aaa39d8f45ad346a250145d 100644 --- a/dataproc/api/models/reference_model.py +++ b/dataproc/api/models/reference_model.py @@ -1,4 +1,5 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class Reference(StructuredNode): - uid=UniqueIdProperty() \ No newline at end of file + uuid=StringProperty(unique_index=True, default=uuid4) \ No newline at end of file diff --git a/dataproc/api/models/refinement_model.py b/dataproc/api/models/refinement_model.py index 3b7a500fdc6ae951c72b9cbaf5d57ee4e24edc81..6ccb0a403d266bdcdc5ee3e5e89f4f81a3a37fe4 100644 --- a/dataproc/api/models/refinement_model.py +++ b/dataproc/api/models/refinement_model.py @@ -1,7 +1,8 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo, DateTimeProperty +from uuid import uuid4 class Refinement(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) dp_step_name=StringProperty() created_at=DateTimeProperty() updated_at=DateTimeProperty() \ No newline at end of file diff --git a/dataproc/api/models/rhofit_model.py b/dataproc/api/models/rhofit_model.py index fd931b62eabcdafb4e405b6e095ea4b6e15633a4..8170cb8e7a388887ecc26d62024ae9dfe8ca8ee6 100644 --- a/dataproc/api/models/rhofit_model.py +++ b/dataproc/api/models/rhofit_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class Rhofit(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) tool_name=StringProperty() \ No newline at end of file diff --git a/dataproc/api/models/scalepackfile_model.py b/dataproc/api/models/scalepackfile_model.py index 322ecc1047485c832195574d525473098c2298f9..d680b1d7faa5a2e104ff67be8e8f58d9a59f54f1 100644 --- a/dataproc/api/models/scalepackfile_model.py +++ b/dataproc/api/models/scalepackfile_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class ScalepackFile(StructuredNode): - uid=UniqueIdProperty() - rsf_filetype=StringProperty(unique_index=True, required=True) + uuid=StringProperty(unique_index=True, default=uuid4) + rsf_filetype=StringProperty() diff --git a/dataproc/api/models/statisticalreport_model.py b/dataproc/api/models/statisticalreport_model.py index e2d64c67aa64f7c4c1698e7c6b0ca3742aed6738..ad038c0f39c688b09a9e2fa37220a13b7110f3a2 100644 --- a/dataproc/api/models/statisticalreport_model.py +++ b/dataproc/api/models/statisticalreport_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class StatisticalReport(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) report_name=StringProperty() \ No newline at end of file diff --git a/dataproc/api/models/summaryhtml_model.py b/dataproc/api/models/summaryhtml_model.py index fb655287884f8cfbccc595126af300fb7fbd086f..c9d45cb1b9cf226f2f00bae85f930cd9abf31d6f 100644 --- a/dataproc/api/models/summaryhtml_model.py +++ b/dataproc/api/models/summaryhtml_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class SummaryHtml(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) report_name=StringProperty() \ No newline at end of file diff --git a/dataproc/api/models/summaryout_model.py b/dataproc/api/models/summaryout_model.py index 7c4fc32f9505e4ef3ddafeeb855d72b279e92528..6f2fea50fada26da883f2b12ba8e786f960c3600 100644 --- a/dataproc/api/models/summaryout_model.py +++ b/dataproc/api/models/summaryout_model.py @@ -1,5 +1,6 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class SummaryOut(StructuredNode): - uid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) report_name=StringProperty() \ No newline at end of file diff --git a/dataproc/api/models/user_model.py b/dataproc/api/models/user_model.py index ff101d8a5e4a2d04844cb6b394d41c8a15d9d5a1..56a715eab269b0c4e77dadbba513282ce979e18d 100644 --- a/dataproc/api/models/user_model.py +++ b/dataproc/api/models/user_model.py @@ -1,6 +1,8 @@ from neomodel import StructuredNode, StringProperty, IntegerProperty,UniqueIdProperty, RelationshipTo +from uuid import uuid4 class User(StructuredNode): - uid=UniqueIdProperty() + # uuid=UniqueIdProperty() + uuid=StringProperty(unique_index=True, default=uuid4) name=StringProperty() surname=StringProperty() diff --git a/dataproc/api/views/__pycache__/user_view.cpython-38.pyc b/dataproc/api/views/__pycache__/user_view.cpython-38.pyc index 3dae84405ea6ea50f29e2105b00837c6473b49f6..6e68b7667bb88fc8c15ae268da7cccc35104c4a1 100644 Binary files a/dataproc/api/views/__pycache__/user_view.cpython-38.pyc and b/dataproc/api/views/__pycache__/user_view.cpython-38.pyc differ diff --git a/dataproc/api/views/connectors.py b/dataproc/api/views/connectors.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dataproc/api/views/user_view.py b/dataproc/api/views/user_view.py index a86e98ceed96d5983947ad7e7cbcc298099639b3..d4ad8f622950ad056865c81fae01c320fc53277d 100644 --- a/dataproc/api/views/user_view.py +++ b/dataproc/api/views/user_view.py @@ -20,11 +20,11 @@ def indexUser(request): if request.method=='GET': try: - users=User.nodes.all(lazy=False) + users=User.nodes.all() response=[] for user in users : obj= { - "uid": user.uid, + "uuid": user.uuid, "name": user.name, } response.append(obj) @@ -43,8 +43,8 @@ def showUser(request): name=request.GET.get('name', ' ') try: user=User.nodes.get(name=name) - # return JsonResponse({"uid": user.uid, "name": user.name}, safe=False) - return JsonResponse({user}, safe=False) + return JsonResponse({"uuid": user.uuid, "name": user.name}, safe=False) + # return JsonResponse({user}, safe=False) except : return JsonResponse({"error":"Error occurred"}, safe=False) @@ -61,7 +61,7 @@ def storeUser(request): try: user=User(name=name) user.save() - return JsonResponse({"uid": user.uid}) + return JsonResponse({"uuid": user.uuid}) except : return JsonResponse({"error":"Error occurred"}, safe=False) @@ -75,12 +75,12 @@ def updateUser(request): if request.method=='PUT': json_data=json.loads(request.body) name=json_data['name'] - uid=json_data['uid'] + uuid=json_data['uuid'] try: - user=User.nodes.get(uid=uid) + user=User.nodes.get(uuid=uuid) user.name=name user.save() - return JsonResponse({"uid": user.uid, "name": name}, safe=False) + return JsonResponse({"uuid": user.uuid, "name": name}, safe=False) except: return JsonResponse({"error":"Error occurred"}, safe=False) @@ -88,14 +88,14 @@ def updateUser(request): def destroyUser(request): """ - Delete one user by uid + Delete one user by uuid """ if request.method=='DELETE': json_data=json.loads(request.body) - uid=json_data['uid'] + uuid=json_data['uuid'] try: - user=User.nodes.get(uid=uid) + user=User.nodes.get(uuid=uuid) user.delete() return JsonResponse({"success": "User deleted"}, safe=False) except: