elody 0.0.213__tar.gz → 0.0.215__tar.gz

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.
Files changed (52) hide show
  1. {elody-0.0.213 → elody-0.0.215}/PKG-INFO +1 -1
  2. {elody-0.0.213 → elody-0.0.215}/pyproject.toml +1 -1
  3. {elody-0.0.213 → elody-0.0.215}/src/elody/object_configurations/elody_configuration.py +44 -2
  4. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/helpers.py +9 -1
  5. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/permission_handler.py +5 -1
  6. {elody-0.0.213 → elody-0.0.215}/src/elody.egg-info/PKG-INFO +1 -1
  7. {elody-0.0.213 → elody-0.0.215}/LICENSE +0 -0
  8. {elody-0.0.213 → elody-0.0.215}/README.md +0 -0
  9. {elody-0.0.213 → elody-0.0.215}/setup.cfg +0 -0
  10. {elody-0.0.213 → elody-0.0.215}/src/__init__.py +0 -0
  11. {elody-0.0.213 → elody-0.0.215}/src/elody/__init__.py +0 -0
  12. {elody-0.0.213 → elody-0.0.215}/src/elody/client.py +0 -0
  13. {elody-0.0.213 → elody-0.0.215}/src/elody/csv.py +0 -0
  14. {elody-0.0.213 → elody-0.0.215}/src/elody/error_codes.py +0 -0
  15. {elody-0.0.213 → elody-0.0.215}/src/elody/exceptions.py +0 -0
  16. {elody-0.0.213 → elody-0.0.215}/src/elody/job.py +0 -0
  17. {elody-0.0.213 → elody-0.0.215}/src/elody/loader.py +0 -0
  18. {elody-0.0.213 → elody-0.0.215}/src/elody/migration/__init__.py +0 -0
  19. {elody-0.0.213 → elody-0.0.215}/src/elody/migration/base_object_migrator.py +0 -0
  20. {elody-0.0.213 → elody-0.0.215}/src/elody/object_configurations/__init__.py +0 -0
  21. {elody-0.0.213 → elody-0.0.215}/src/elody/object_configurations/base_object_configuration.py +0 -0
  22. {elody-0.0.213 → elody-0.0.215}/src/elody/object_configurations/job_configuration.py +0 -0
  23. {elody-0.0.213 → elody-0.0.215}/src/elody/object_configurations/saved_search_configuration.py +0 -0
  24. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/__init__.py +0 -0
  25. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authentication/__init__.py +0 -0
  26. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authentication/base_user_tenant_validation_policy.py +0 -0
  27. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authentication/multi_tenant_policy.py +0 -0
  28. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/__init__.py +0 -0
  29. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/filter_generic_objects_policy.py +0 -0
  30. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py +0 -0
  31. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/generic_object_detail_policy.py +0 -0
  32. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/generic_object_mediafiles_policy.py +0 -0
  33. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/generic_object_metadata_policy.py +0 -0
  34. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/generic_object_relations_policy.py +0 -0
  35. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/generic_object_request_policy.py +0 -0
  36. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/generic_object_request_policy_v2.py +0 -0
  37. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/mediafile_derivatives_policy.py +0 -0
  38. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/mediafile_download_policy.py +0 -0
  39. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/multi_tenant_policy.py +0 -0
  40. {elody-0.0.213 → elody-0.0.215}/src/elody/policies/authorization/tenant_request_policy.py +0 -0
  41. {elody-0.0.213 → elody-0.0.215}/src/elody/schemas.py +0 -0
  42. {elody-0.0.213 → elody-0.0.215}/src/elody/util.py +0 -0
  43. {elody-0.0.213 → elody-0.0.215}/src/elody/validator.py +0 -0
  44. {elody-0.0.213 → elody-0.0.215}/src/elody.egg-info/SOURCES.txt +0 -0
  45. {elody-0.0.213 → elody-0.0.215}/src/elody.egg-info/dependency_links.txt +0 -0
  46. {elody-0.0.213 → elody-0.0.215}/src/elody.egg-info/requires.txt +0 -0
  47. {elody-0.0.213 → elody-0.0.215}/src/elody.egg-info/top_level.txt +0 -0
  48. {elody-0.0.213 → elody-0.0.215}/src/tests/__init_.py +0 -0
  49. {elody-0.0.213 → elody-0.0.215}/src/tests/data.py +0 -0
  50. {elody-0.0.213 → elody-0.0.215}/src/tests/unit/__init__.py +0 -0
  51. {elody-0.0.213 → elody-0.0.215}/src/tests/unit/test_csv.py +0 -0
  52. {elody-0.0.213 → elody-0.0.215}/src/tests/unit/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elody
3
- Version: 0.0.213
3
+ Version: 0.0.215
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "elody"
9
- version = "0.0.213"
9
+ version = "0.0.215"
10
10
  description = "elody SDK for Python"
11
11
  readme = "README.md"
12
12
  authors = [{ name = "Inuits", email = "developers@inuits.eu" }]
@@ -1,3 +1,4 @@
1
+ from copy import deepcopy
1
2
  from datetime import datetime, timezone
2
3
  from elody.object_configurations.base_object_configuration import (
3
4
  BaseObjectConfiguration,
@@ -158,6 +159,9 @@ class ElodyConfiguration(BaseObjectConfiguration):
158
159
  lines = value.splitlines()
159
160
  value = "\n".join(line.strip() for line in lines).strip()
160
161
  element[object_list_value_field_name] = value.strip()
162
+ for key, value in deepcopy(element).items():
163
+ if not value:
164
+ del element[key]
161
165
  return sanitized_document
162
166
 
163
167
  def __patch_document_audit_info(self, crud, document, timestamp):
@@ -179,7 +183,45 @@ class ElodyConfiguration(BaseObjectConfiguration):
179
183
  def _sorting(self, key_order_map, **_):
180
184
  addFields, sort = {}, {}
181
185
  for key, order in key_order_map.items():
182
- if key not in ["date_created", "date_updated", "last_editor"]:
186
+ if key == "order":
187
+ addFields.update(
188
+ {
189
+ key: {
190
+ "$arrayElemAt": [
191
+ {
192
+ "$map": {
193
+ "input": {
194
+ "$filter": {
195
+ "input": "$relations",
196
+ "as": "relation",
197
+ "cond": {
198
+ "$eq": [
199
+ {
200
+ "$arrayElemAt": [
201
+ "$$relation.metadata.key",
202
+ 0,
203
+ ]
204
+ },
205
+ key,
206
+ ]
207
+ },
208
+ }
209
+ },
210
+ "as": "relation",
211
+ "in": {
212
+ "$arrayElemAt": [
213
+ "$$relation.metadata.value",
214
+ 0,
215
+ ]
216
+ },
217
+ }
218
+ },
219
+ 0,
220
+ ]
221
+ }
222
+ }
223
+ )
224
+ elif key not in ["date_created", "date_updated", "last_editor"]:
183
225
  addFields.update(
184
226
  {
185
227
  key: {
@@ -196,7 +238,7 @@ class ElodyConfiguration(BaseObjectConfiguration):
196
238
  }
197
239
  },
198
240
  "as": "metadata",
199
- "in": { "$toLower": "$$metadata.value" },
241
+ "in": {"$toLower": "$$metadata.value"},
200
242
  }
201
243
  },
202
244
  0,
@@ -44,7 +44,15 @@ def get_item(storage_manager, user_context_bag, view_args) -> dict:
44
44
  view_args = view_args or {}
45
45
  if id := view_args.get("id"):
46
46
  resolve_collections = user_context_bag.get("collection_resolver")
47
- collections = resolve_collections(collection=view_args.get("collection"), id=id)
47
+ collection = (
48
+ get_object_configuration_mapper()
49
+ .get(view_args.get("type"))
50
+ .crud()
51
+ .get("collection")
52
+ )
53
+ collections = resolve_collections(
54
+ collection=view_args.get("collection", collection), id=id
55
+ )
48
56
  for collection in collections:
49
57
  if item := storage_manager.get_db_engine().get_item_from_collection_by_id(
50
58
  collection, id
@@ -260,7 +260,11 @@ def __item_value_in_values(
260
260
  if key_of_relation:
261
261
  if isinstance(item_value, list):
262
262
  item_value = item_value[0]
263
- item = get_item(StorageManager(), user_context.bag, {"id": item_value})
263
+ item = get_item(
264
+ StorageManager(),
265
+ user_context.bag,
266
+ {"type": keys[1].split("-", 1)[0], "id": item_value},
267
+ )
264
268
  flat_item, _ = get_flat_item_and_object_lists(item)
265
269
  return __item_value_in_values(
266
270
  flat_item, key_of_relation, values, flat_request_body, user_context
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elody
3
- Version: 0.0.213
3
+ Version: 0.0.215
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes