elody 0.0.183__tar.gz → 0.0.184__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.
- {elody-0.0.183 → elody-0.0.184}/PKG-INFO +1 -1
- {elody-0.0.183 → elody-0.0.184}/pyproject.toml +1 -1
- {elody-0.0.183 → elody-0.0.184}/src/elody/object_configurations/elody_configuration.py +9 -15
- {elody-0.0.183 → elody-0.0.184}/src/elody/object_configurations/job_configuration.py +1 -1
- {elody-0.0.183 → elody-0.0.184}/src/elody.egg-info/PKG-INFO +1 -1
- {elody-0.0.183 → elody-0.0.184}/LICENSE +0 -0
- {elody-0.0.183 → elody-0.0.184}/README.md +0 -0
- {elody-0.0.183 → elody-0.0.184}/setup.cfg +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/__init__.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/__init__.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/client.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/csv.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/error_codes.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/exceptions.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/job.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/loader.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/migration/__init__.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/migration/base_object_migrator.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/object_configurations/__init__.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/object_configurations/base_object_configuration.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/__init__.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authentication/__init__.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authentication/base_user_tenant_validation_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authentication/multi_tenant_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/__init__.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/filter_generic_objects_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_detail_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_mediafiles_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_metadata_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_relations_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_request_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_request_policy_v2.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/mediafile_derivatives_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/mediafile_download_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/multi_tenant_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/tenant_request_policy.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/helpers.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/permission_handler.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/policies/tenant_id_resolver.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/schemas.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/util.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody/validator.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody.egg-info/SOURCES.txt +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody.egg-info/dependency_links.txt +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody.egg-info/requires.txt +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/elody.egg-info/top_level.txt +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/tests/__init_.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/tests/data.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/tests/unit/__init__.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/tests/unit/test_csv.py +0 -0
- {elody-0.0.183 → elody-0.0.184}/src/tests/unit/test_utils.py +0 -0
|
@@ -17,7 +17,9 @@ class ElodyConfiguration(BaseObjectConfiguration):
|
|
|
17
17
|
"creator": lambda post_body, **kwargs: self._creator(post_body, **kwargs),
|
|
18
18
|
"post_crud_hook": lambda **kwargs: self._post_crud_hook(**kwargs),
|
|
19
19
|
"pre_crud_hook": lambda **kwargs: self._pre_crud_hook(**kwargs),
|
|
20
|
-
"sorting": lambda key_order_map, **kwargs: self._sorting(
|
|
20
|
+
"sorting": lambda key_order_map, **kwargs: self._sorting(
|
|
21
|
+
key_order_map, **kwargs
|
|
22
|
+
),
|
|
21
23
|
}
|
|
22
24
|
return {**super().crud(), **crud}
|
|
23
25
|
|
|
@@ -72,18 +74,10 @@ class ElodyConfiguration(BaseObjectConfiguration):
|
|
|
72
74
|
object_list_key,
|
|
73
75
|
)
|
|
74
76
|
document = {**template, **document_defaults, **post_body}
|
|
75
|
-
|
|
76
|
-
document = self._sanitize_document(
|
|
77
|
-
document=document,
|
|
78
|
-
object_list_name="metadata",
|
|
79
|
-
object_list_value_field_name="value",
|
|
80
|
-
)
|
|
81
|
-
document = self._sort_document_keys(document)
|
|
77
|
+
document = self._pre_crud_hook(crud="create", document=document)
|
|
82
78
|
return document
|
|
83
79
|
|
|
84
|
-
def _document_content_patcher(
|
|
85
|
-
self, *, document, content, overwrite=False, **kwargs
|
|
86
|
-
):
|
|
80
|
+
def _document_content_patcher(self, *, document, content, overwrite=False, **_):
|
|
87
81
|
object_lists = self.document_info().get("object_lists", {})
|
|
88
82
|
if overwrite:
|
|
89
83
|
document = content
|
|
@@ -130,9 +124,9 @@ class ElodyConfiguration(BaseObjectConfiguration):
|
|
|
130
124
|
if not element[object_list_value_field_name]:
|
|
131
125
|
sanitized_document[object_list_name].remove(element)
|
|
132
126
|
return sanitized_document
|
|
133
|
-
|
|
127
|
+
|
|
134
128
|
def __patch_document(self, crud, document):
|
|
135
|
-
document.update({"
|
|
129
|
+
document.update({f"date_{crud}d": datetime.now(timezone.utc)})
|
|
136
130
|
if email := self._get_user_context_id():
|
|
137
131
|
document.update({"last_editor": email})
|
|
138
132
|
return document
|
|
@@ -140,7 +134,7 @@ class ElodyConfiguration(BaseObjectConfiguration):
|
|
|
140
134
|
def _sorting(self, key_order_map, **_):
|
|
141
135
|
addFields, sort = {}, {}
|
|
142
136
|
for key, order in key_order_map.items():
|
|
143
|
-
if key
|
|
137
|
+
if key not in ["date_created", "date_updated", "last_editor"]:
|
|
144
138
|
addFields.update(
|
|
145
139
|
{
|
|
146
140
|
key: {
|
|
@@ -166,7 +160,7 @@ class ElodyConfiguration(BaseObjectConfiguration):
|
|
|
166
160
|
}
|
|
167
161
|
)
|
|
168
162
|
sort.update({key: order})
|
|
169
|
-
|
|
163
|
+
|
|
170
164
|
pipeline = [{"$sort": sort}]
|
|
171
165
|
if addFields:
|
|
172
166
|
pipeline.append({"$addFields": addFields})
|
|
@@ -31,7 +31,7 @@ class JobConfiguration(ElodyConfiguration):
|
|
|
31
31
|
def _creator(self, post_body, *, get_user_context={}, **_):
|
|
32
32
|
document = super()._creator(post_body)
|
|
33
33
|
if email := get_user_context().email:
|
|
34
|
-
document["
|
|
34
|
+
document["last_editor"] = email
|
|
35
35
|
return document
|
|
36
36
|
|
|
37
37
|
def _post_crud_hook(self, *, crud, document, get_rabbit, **kwargs):
|
|
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
|
{elody-0.0.183 → elody-0.0.184}/src/elody/object_configurations/base_object_configuration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/filter_generic_objects_policy.py
RENAMED
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_detail_policy.py
RENAMED
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_mediafiles_policy.py
RENAMED
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_metadata_policy.py
RENAMED
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_relations_policy.py
RENAMED
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_request_policy.py
RENAMED
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/generic_object_request_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/mediafile_derivatives_policy.py
RENAMED
|
File without changes
|
{elody-0.0.183 → elody-0.0.184}/src/elody/policies/authorization/mediafile_download_policy.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|