elody 0.0.173__py3-none-any.whl → 0.0.175__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
elody/job.py CHANGED
@@ -51,6 +51,33 @@ def start_job(
51
51
  return job["_id"]
52
52
 
53
53
 
54
+ def add_document_to_job(
55
+ id,
56
+ id_of_document_job_was_initiated_for,
57
+ type_of_document_job_was_initiated_for,
58
+ *,
59
+ get_rabbit,
60
+ ):
61
+ relations = []
62
+ if id_of_document_job_was_initiated_for and type_of_document_job_was_initiated_for:
63
+ relations.append(
64
+ {"key": id_of_document_job_was_initiated_for, "type": "isJobFor"}
65
+ )
66
+ document = {
67
+ "id": id,
68
+ "patch": {
69
+ "relations": (relations),
70
+ },
71
+ }
72
+ _post_crud_hook(crud="update", document=document, get_rabbit=get_rabbit)
73
+ __patch_document_job_was_initiated_for_v2(
74
+ id,
75
+ id_of_document_job_was_initiated_for,
76
+ type_of_document_job_was_initiated_for,
77
+ get_rabbit,
78
+ )
79
+
80
+
54
81
  def finish_job(
55
82
  id,
56
83
  id_of_document_job_was_initiated_for=None,
@@ -93,3 +120,12 @@ def __patch_document_job_was_initiated_for(id, type, get_rabbit):
93
120
  "patch": {"relations": [{"key": id, "type": "hasJob"}]},
94
121
  }
95
122
  _post_crud_hook(crud="update", document=document, get_rabbit=get_rabbit)
123
+
124
+
125
+ def __patch_document_job_was_initiated_for_v2(job_id, document_id, type, get_rabbit):
126
+ if id and type:
127
+ document = {
128
+ "document_info_job_was_initiated_for": {"id": document_id, "type": type},
129
+ "patch": {"relations": [{"key": job_id, "type": "hasJob"}]},
130
+ }
131
+ _post_crud_hook(crud="update", document=document, get_rabbit=get_rabbit)
@@ -199,7 +199,8 @@ def __is_allowed_to_crud_item_keys(
199
199
  info["object_key"],
200
200
  object_lists,
201
201
  )
202
- item_in_storage_format[info["key"]].remove(element)
202
+ if element:
203
+ item_in_storage_format[info["key"]].remove(element)
203
204
  break
204
205
  else:
205
206
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: elody
3
- Version: 0.0.173
3
+ Version: 0.0.175
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -4,7 +4,7 @@ elody/client.py,sha256=VFjUUaE9edtK1XuAF5T3ayem2UEBr-Anww8AhITYLdI,8575
4
4
  elody/csv.py,sha256=5LZfr6p8eeK0IDHICfyBgKSMRCM-YXzXaomzl7G1-bc,15518
5
5
  elody/error_codes.py,sha256=7ZLY69YScCB0Ghxqf2LiCt-U_JCYA_T8jTMlIDlvv2s,4179
6
6
  elody/exceptions.py,sha256=5KSw2sPCZz3lDIJX4LiR2iL9n4m4KIil04D1d3X5rd0,968
7
- elody/job.py,sha256=QnN6Q45yqRimziqJX9SHrTVFVvky5mAc1WEza9ia8_w,2811
7
+ elody/job.py,sha256=wpq1dSxYxMv1Jv1hSvyxvFI1qNbRkDNghRLhndo57rU,3923
8
8
  elody/loader.py,sha256=Mr7zyP5DP5psYerf2-DnP90GiqtFlKZpcLIPD7P4pSU,5242
9
9
  elody/schemas.py,sha256=WtKdZEAX-PtEuAaRohyS3Md8H4-8yKVXMkHfCQ2SDR4,4676
10
10
  elody/util.py,sha256=1Ty4A3OVSmwawqjKyYW5zkhSwX-jZsC0_XllO_DL05M,8684
@@ -17,7 +17,7 @@ elody/object_configurations/elody_configuration.py,sha256=uoTYN0lzWh3Z0uN4k-o-Sb
17
17
  elody/object_configurations/job_configuration.py,sha256=simi4TBiZ5cQePlzFHAd-C-khViWN9VUbAOKq9FYwk8,2057
18
18
  elody/policies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  elody/policies/helpers.py,sha256=AV3wtvthJafW6ueEYGxggB5kk5knWTWzh3zq29Y1-ws,1434
20
- elody/policies/permission_handler.py,sha256=WpUprwtDNb3Q0AY_cDYwAoYeDnoPmU8rHUIjZAM5n3M,9566
20
+ elody/policies/permission_handler.py,sha256=HIKWzl736qaeATJOhXSR_4f7taTEjYCR1t__9F6u39U,9606
21
21
  elody/policies/tenant_id_resolver.py,sha256=BIl6lr9AH6Q_aZSsxF24B7ramkIZH-R-8bpLrTvYLtM,13796
22
22
  elody/policies/authentication/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  elody/policies/authentication/base_user_tenant_validation_policy.py,sha256=fxvrB4iG6fehBh6b4XS8AWewtNsCABgSooma5ljjZk4,5144
@@ -40,8 +40,8 @@ tests/data.py,sha256=Q3oxduf-E3m-Z5G_p3fcs8jVy6g10I7zXKL1m94UVMI,2906
40
40
  tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  tests/unit/test_csv.py,sha256=NQaOhehfQ4GuXku0Y1SA8DYjJeqqidbF50zEHAi8RZA,15923
42
42
  tests/unit/test_utils.py,sha256=g63szcEZyHhCOtrW4BnNbcgVca3oYPIOLjBdIzNwwN0,8784
43
- elody-0.0.173.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
44
- elody-0.0.173.dist-info/METADATA,sha256=nfOQWnTD2J_dXwPlvl1qsIqqWLABMbyqCQ7Ry1i0dx4,23336
45
- elody-0.0.173.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
46
- elody-0.0.173.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
47
- elody-0.0.173.dist-info/RECORD,,
43
+ elody-0.0.175.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
44
+ elody-0.0.175.dist-info/METADATA,sha256=8GKEiTnsDwr4J7W9LB5AMM3Dy3PCCVM-bh0QwaAaPpo,23336
45
+ elody-0.0.175.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
46
+ elody-0.0.175.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
47
+ elody-0.0.175.dist-info/RECORD,,