From f39391cf7f66eac6f438c94f2f1ab3438655bb69 Mon Sep 17 00:00:00 2001 From: root <Yorgo EL MOUBAYED> Date: Tue, 16 Mar 2021 15:36:20 +0100 Subject: [PATCH] Converted to uuid4 --- .../construct_model.cpython-38.pyc | Bin 782 -> 847 bytes .../__pycache__/user_model.cpython-38.pyc | Bin 531 -> 597 bytes dataproc/api/models/autoPROC_model.py | 3 ++- dataproc/api/models/buster_model.py | 3 ++- dataproc/api/models/construct_model.py | 3 ++- dataproc/api/models/coordinates_model.py | 4 ++-- dataproc/api/models/ligandsfitting_model.py | 3 ++- dataproc/api/models/mmciffile_model.py | 5 ++-- dataproc/api/models/mtzfile_model.py | 5 ++-- dataproc/api/models/pdbfile_model.py | 5 ++-- dataproc/api/models/postrefinement_model.py | 3 ++- dataproc/api/models/reductionscaling_model.py | 3 ++- dataproc/api/models/reference_model.py | 3 ++- dataproc/api/models/refinement_model.py | 3 ++- dataproc/api/models/rhofit_model.py | 3 ++- dataproc/api/models/scalepackfile_model.py | 5 ++-- .../api/models/statisticalreport_model.py | 3 ++- dataproc/api/models/summaryhtml_model.py | 3 ++- dataproc/api/models/summaryout_model.py | 3 ++- dataproc/api/models/user_model.py | 4 +++- .../__pycache__/user_view.cpython-38.pyc | Bin 2277 -> 2290 bytes dataproc/api/views/connectors.py | 0 dataproc/api/views/user_view.py | 22 +++++++++--------- 23 files changed, 52 insertions(+), 34 deletions(-) create mode 100644 dataproc/api/views/connectors.py 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 GIT binary patch delta 337 zcmXAjze>bF5XSdUvYW(2?>YrV6q_Jiqm2-31g{f8ZMHGT%?g2BqDdCS#v-;Jggl3j zVBr(k=M^k`1!v<9`|+D^*l%YozD0BwMFGLH{<=<ox@eCk-SPe*5Ma4jNhK+n6X4*y z5pXnZx$?lhA+hLE6~uIKjmhA2*-dv|FEK?EMS&=$IZ*8YduPhkyd_F#X;WIJJS2A{ zA4!Z9Ajy$7z{7NZ@Gr`uZYr~EZeuotrpTU*zRwEK&w~X0urPV^vb}iBW~&l(UeC(@ zgnn#s+@X>vgJT!#f9YIItT*WsmL7PBKHfS+@mNR&52&rmPOf6V|71sJo5*9x=vM#l XtvAvXY48&K*5vw}VplsTyEK%4u7OE+ delta 299 zcmX@l*2l&h%FD~e00dbX-U-_#^2#zAOw^Vab7x3lN?~qcNMTN8Y-WyPOJNCS&}5yM z6IGuKQj83kfgA@QE(Q^)3{i|J3{gy}%*_l@EUBzOk}Z`zg)xPxnJJ0`$YKVwIDsq{ zFpCSwVg<9fQ`mrZu;1cz&d)0@DJo4asgg)6$kfZtPf5)w*2_;$iw80%=P@qlX9e1H zi>0(QGo=V*`(za+cQ#%iqlkBMAya}PJCMl%#Kk-y1```28#5Op2o`~4{507oe_~S6 g1+j}Dy5KB6AnO)~4bYy_oK!nTAg`DSNXW1Q0INYc4*&oF 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 GIT binary patch delta 291 zcmXYq!AiqG5QcYlH`!Ry&>qE#AO#Ixy$Ho?QA7moWj)y9j1Wj7CN6ldR}Udi;bZ7K zc-e;$XM+Rt^Uu%BH@*JR*=jr<39gH;oAo|)*$ful$-yBClx18QYd|aoD%9@+HNjTd z1fyG#$KBeFa`2IJ1)e^3)7{HCV@Oy)VI?U9(kMTqjYw^UjR!TT_*Q$pYN@%)rB7X5 zyf}I&YNR)Bke)WKeC>XZj}+4y!{T*#;dQ;K$ePwQ!F-Bl5*8-?72NM7Y&CZqvm`Qw p7@Ck>=R5s3%+E6R18YeCFGDskrtEyOsGiZ4bPhbV0XBnF{sC8yKG6UG delta 247 zcmcc0GMR-hl$V!_0SGcOy%WwbOyrYcG?=I@FXqmW!j!_?!jQt8%Gk^t#g@Vn%%I6S zF(=9;8KfE+FakLaKwK;bBvKio7*iOcm{OUW8KPKHS%D-Qm}F031e(BfizT!;wP><2 zqlOwQQ28z9(#(`1W)O=dFEKYYioLkB2*g;)P{a!qE#jTr#278j4rGE96|(^e4n{U0 qECPx7X|hlL!Kk7OVnfx#S$sg&Ee@O9{FKt1R6CF(i<y9g3=;r6VJwLN diff --git a/dataproc/api/models/autoPROC_model.py b/dataproc/api/models/autoPROC_model.py index fb60198..49db050 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 82ae0be..7ffec8e 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 a30b076..34141f1 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 c2bf745..19b910c 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 ef56a15..796c5d3 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 b58468d..c6e6f40 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 35ff5b0..1b1a356 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 1efa8c7..4ee6712 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 c6f16e4..08a078b 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 dbab87c..21a5d60 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 7ba8afb..f092588 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 3b7a500..6ccb0a4 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 fd931b6..8170cb8 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 322ecc1..d680b1d 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 e2d64c6..ad038c0 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 fb65528..c9d45cb 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 7c4fc32..6f2fea5 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 ff101d8..56a715e 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 GIT binary patch delta 883 zcma))L2DC16vyYy&dzR<ZX{5eV3W8tG_s{A3SLA6p(zMOg&M3Pq_MMVS50uTL0UKX z33{4q56P+YC|<=c;5S&on`gn3cqq=B)!0f8&a!{ro7tK7`@h+*rSB!L?Rj~k$D0p# zH;>+VO{hdVOGrcnJg4%>?u{5CI<_W6-GTB=x=%+ep<|w~2>^LjkDY`HORzn9pR5xw zPwWU=@NLNEIeDO0Hi&T6N#LpjsGm8cDH{&AMap{Jm*J}V4A;4%%Su<(=rx#A8&uBb zfq_dIup`c9pa>jfMSY>Qwaw#zk2ETbsn8G;I)dG1Y(*@h31}o3(b!IC#PzF@_Nm~) zIRR>`i_W}yXf3{V^`Sq(KLm-9<XTo`4#NV<jF#JhD?LnXEvfZ1j3vXgh(b{^4>}4g zS;7f()+|PIQz`2xbqCM-uiJxAHgq;967|h0I8dS5WK{t>XqcU6ag#Z83Xwq>6!nQ+ zSjN?WnQCb+8uWV|(T%&O7glw92^#8_{n6MpCu_r|!0Cnync+HeoI~+Z{<@yW)Sxb4 zG;Km)Xa3Jm*G-XWC!DMwWwpmIK~o#9sg(CGFXVkaR>Buy9QyrU=nr*={Kq>!{w!uK z<tweV*1c8+y{LAa>ej!vl=~0plnYbEAph>4G_)r{|8V|rmP<?8OyH$Xrz84XosO)l ct8P1}pv5W*UZrfJ;Frg4+}wRxy?3wt0?0O=u>b%7 delta 965 zcmaiy&ui2`6vy)>lSxuHYg>?Av2|lxwxkvmkK(Cz+k@ImyIMint~;SNuDdu%4_&hC zU(i!df`|4by$JpT;-BD6$X&gA5j=?RP3USV;)Hy8^W**a%)IYYU#7gK=S>(m-bMFz ze!TbUFzVqfH6la83#OvMN&*p!Ov$8q2t(L4hAf3u<LS)MOwEYnZ%O`!4SC9rM9Pl= zj8}7soig;W4%s7P(*XS?wiMFdgJNA6k8x+)kj|zNxP!`sk7GSd{Gi?K`ulOHV!f1` z>y53o0CL`K4-QUPZtm~NocG!<!|W5>5e`<X+-#cNhD!E;sZkj?IE(}TC3p$SAV6Kl zGaW!V9VQw!{&(?@w^7EtTWG-%)ovcMAq=i2$QU89<VepFD`n3?T2h=Lv!pE@B*XQ| zLpDZp5p5!SXx5*&nByn-C!ok$Q*`C3MB<@r1VWW*Vxi>bZkQ-e(~BewB{0=A+2pJ) zkyOS~&Ayp6n@tkvZ07N|^ZL{kI-oCSoTf;-5jd)xeddeHv>R|8Id`MD-)qTs(*8%1 zC2I*5vZnQ6q{EXh(&z+qljo5x6i79y!zZ~$@`r1NraIOfS%j&>1y;d2Ki=0##?*Gf zUd>*M8?cDLv)NbCANjglR>N+Xgnqvl>K5{!9r)NTMI(vT#{I@tqo}!#(Q`ZA?{vaA z9+aBcZ@$#d@;r+Bf0Ua>E(-tR!HR2D8scpIr{!DD^3-*#BJgs%)sp>AtEFn$iqj0J XUDYhf0?8r?o&4+3_48M=kIt>%JZrDF diff --git a/dataproc/api/views/connectors.py b/dataproc/api/views/connectors.py new file mode 100644 index 0000000..e69de29 diff --git a/dataproc/api/views/user_view.py b/dataproc/api/views/user_view.py index a86e98c..d4ad8f6 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: -- GitLab