elody 0.0.209__py3-none-any.whl → 0.0.211__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.
@@ -107,6 +107,16 @@ class ElodyConfiguration(BaseObjectConfiguration):
107
107
  ):
108
108
  document[key].remove(item_element)
109
109
  break
110
+ else:
111
+ for value_element in value:
112
+ for item_element in document[key]:
113
+ if (
114
+ item_element[object_lists[key]]
115
+ == value_element[object_lists[key]]
116
+ and item_element["key"] == value_element["key"]
117
+ ):
118
+ document[key].remove(item_element)
119
+ break
110
120
  if not document.get(key):
111
121
  document[key] = []
112
122
  document[key].extend(value)
@@ -5,7 +5,7 @@ from elody.policies.permission_handler import (
5
5
  get_permissions,
6
6
  handle_single_item_request,
7
7
  )
8
- from flask import Request # pyright: ignore
8
+ from flask import g, Request # pyright: ignore
9
9
  from inuits_policy_based_auth import BaseAuthorizationPolicy # pyright: ignore
10
10
  from inuits_policy_based_auth.contexts.policy_context import ( # pyright: ignore
11
11
  PolicyContext,
@@ -62,7 +62,8 @@ class PutRequestRules:
62
62
  if request.method != "PUT":
63
63
  return None
64
64
 
65
- content = get_content(item, request, {"metadata": request.json})
65
+ content = g.get("content") or request.json
66
+ content = get_content(item, request, {"metadata": content})
66
67
  return handle_single_item_request(
67
68
  user_context, item, permissions, "update", content
68
69
  )
@@ -75,7 +76,8 @@ class PatchRequestRules:
75
76
  if request.method != "PATCH":
76
77
  return None
77
78
 
78
- content = get_content(item, request, {"metadata": request.json})
79
+ content = g.get("content") or request.json
80
+ content = get_content(item, request, {"metadata": content})
79
81
  return handle_single_item_request(
80
82
  user_context, item, permissions, "update", content
81
83
  )
@@ -5,7 +5,7 @@ from elody.policies.permission_handler import (
5
5
  get_permissions,
6
6
  handle_single_item_request,
7
7
  )
8
- from flask import Request # pyright: ignore
8
+ from flask import g, Request # pyright: ignore
9
9
  from inuits_policy_based_auth import BaseAuthorizationPolicy # pyright: ignore
10
10
  from inuits_policy_based_auth.contexts.policy_context import ( # pyright: ignore
11
11
  PolicyContext,
@@ -58,7 +58,8 @@ class PostRequestRules:
58
58
  if request.method != "POST":
59
59
  return None
60
60
 
61
- content = get_content(item, request, {"relations": request.json})
61
+ content = g.get("content") or request.json
62
+ content = get_content(item, request, {"relations": content})
62
63
  return handle_single_item_request(
63
64
  user_context, item, permissions, "create", content
64
65
  )
@@ -81,7 +82,8 @@ class PutRequestRules:
81
82
  if request.method != "PUT":
82
83
  return None
83
84
 
84
- content = get_content(item, request, {"relations": request.json})
85
+ content = g.get("content") or request.json
86
+ content = get_content(item, request, {"relations": content})
85
87
  return handle_single_item_request(
86
88
  user_context, item, permissions, "update", content
87
89
  )
@@ -94,7 +96,8 @@ class PatchRequestRules:
94
96
  if request.method != "PATCH":
95
97
  return None
96
98
 
97
- content = get_content(item, request, {"relations": request.json})
99
+ content = g.get("content") or request.json
100
+ content = get_content(item, request, {"relations": content})
98
101
  return handle_single_item_request(
99
102
  user_context, item, permissions, "update", content
100
103
  )
@@ -107,7 +110,8 @@ class DeleteRequestRules:
107
110
  if request.method != "DELETE":
108
111
  return None
109
112
 
110
- content = get_content(item, request, {"relations": request.json})
113
+ content = g.get("content") or request.json
114
+ content = get_content(item, request, {"relations": content})
111
115
  return handle_single_item_request(
112
116
  user_context, item, permissions, "delete", content
113
117
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elody
3
- Version: 0.0.209
3
+ Version: 0.0.211
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -13,7 +13,7 @@ elody/migration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  elody/migration/base_object_migrator.py,sha256=n8uvgGfjEUy60G47RD7Y-oxp1vHLOauwPMDl87LcxtU,436
14
14
  elody/object_configurations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  elody/object_configurations/base_object_configuration.py,sha256=8wyUq_zqRkGb4Mp198pyxOaGdz2WMZzVOO65s1SDCRw,7393
16
- elody/object_configurations/elody_configuration.py,sha256=aeCndCipQuS-vSDmuxXlJrB-p2No9QnTrM9GnmhWd3o,7936
16
+ elody/object_configurations/elody_configuration.py,sha256=U-obcuRLL7L5MjB0gk5fUSH2cC_mZIe5uV9a61gwwqs,8486
17
17
  elody/object_configurations/job_configuration.py,sha256=HMDxaRUyfqhIy0q3yQDDMH9uW5iCd7VCmqknQofXNt0,2039
18
18
  elody/policies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  elody/policies/helpers.py,sha256=LTV_Hmg8AN64e6t4glpKhZMsRNYCLN8FC-KQ0-7EmR8,2035
@@ -26,21 +26,21 @@ elody/policies/authorization/filter_generic_objects_policy.py,sha256=mF32moh8hRe
26
26
  elody/policies/authorization/filter_generic_objects_policy_v2.py,sha256=2IkESYMfne1bX1I8Yvn3yoNmlfn_Jm6zVlVBknoW1_c,6412
27
27
  elody/policies/authorization/generic_object_detail_policy.py,sha256=y6g1i3vdKMKY4xS4H2m0e1DRztrivMEomx6NkDqA0Pk,3672
28
28
  elody/policies/authorization/generic_object_mediafiles_policy.py,sha256=1-DMsV-FDkcrQCE4KL-SGlVHjTZSMPwYq1bWln2nXE4,2887
29
- elody/policies/authorization/generic_object_metadata_policy.py,sha256=xwtOVYmiCKgf75CydfWnV7DLI9X1yVfXPQ4-Ux0Htqk,2787
30
- elody/policies/authorization/generic_object_relations_policy.py,sha256=hRLeA5gXB44ufiVVaxWtAuwnXBRY1U4bLWgIadzKtmw,3712
29
+ elody/policies/authorization/generic_object_metadata_policy.py,sha256=0r_DrNBBi4Bh6lMOXB9VqHDtQ9WEVRONigGG2fBFzDw,2882
30
+ elody/policies/authorization/generic_object_relations_policy.py,sha256=n3UYudXZyTqkr9VbJvXs199N4nwgA4GKpnY-vm8Qyqg,3899
31
31
  elody/policies/authorization/generic_object_request_policy.py,sha256=kuLczjnK5omMF2Gw5ViY_Z9MNPx_w6bNwexiMzvLiUU,4867
32
32
  elody/policies/authorization/generic_object_request_policy_v2.py,sha256=gWv8c4XJeRNhzsGO2pYA25q8cRdsi-4xQbJ9Ja_9_QI,5094
33
33
  elody/policies/authorization/mediafile_derivatives_policy.py,sha256=OwNpbS8i7-LzcQDPddMWTrXk_Y4wqZxrB12Lw1dhkr0,2671
34
34
  elody/policies/authorization/mediafile_download_policy.py,sha256=XMsKavBucmTh4W1kWOzpFWxJ_ZXgHVK1RS7JB4HjtQo,1979
35
35
  elody/policies/authorization/multi_tenant_policy.py,sha256=SA9H7SBjzuh8mY3gYN7pDG8TV7hdI3GEUtNeiZeNL3M,3164
36
36
  elody/policies/authorization/tenant_request_policy.py,sha256=dEgblwRAqwWVcE-O7Jn8hVL3OnwDlQhDEOcPlcElBrk,1185
37
- elody-0.0.209.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
37
+ elody-0.0.211.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
38
38
  tests/__init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  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.209.dist-info/METADATA,sha256=4t6i8dXoYtLtHxmWg-3lB2dWI9CMHs6_58apWekIurU,23358
44
- elody-0.0.209.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
- elody-0.0.209.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
46
- elody-0.0.209.dist-info/RECORD,,
43
+ elody-0.0.211.dist-info/METADATA,sha256=ZByAkkaDW_l_NKAK-cuehoII_y-RidDYx8S1aJUg2pg,23358
44
+ elody-0.0.211.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ elody-0.0.211.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
46
+ elody-0.0.211.dist-info/RECORD,,