elody 0.0.164__tar.gz → 0.0.166__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.164 → elody-0.0.166}/PKG-INFO +1 -1
- {elody-0.0.164 → elody-0.0.166}/pyproject.toml +1 -1
- {elody-0.0.164 → elody-0.0.166}/src/elody/client.py +14 -2
- {elody-0.0.164 → elody-0.0.166}/src/elody/csv.py +11 -4
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/permission_handler.py +2 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody.egg-info/PKG-INFO +1 -1
- {elody-0.0.164 → elody-0.0.166}/LICENSE +0 -0
- {elody-0.0.164 → elody-0.0.166}/README.md +0 -0
- {elody-0.0.164 → elody-0.0.166}/setup.cfg +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/__init__.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/__init__.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/error_codes.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/exceptions.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/job.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/loader.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/migration/__init__.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/migration/base_object_migrator.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/object_configurations/__init__.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/object_configurations/base_object_configuration.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/object_configurations/elody_configuration.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/object_configurations/job_configuration.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/__init__.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authentication/__init__.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authentication/base_user_tenant_validation_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authentication/multi_tenant_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/__init__.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/filter_generic_objects_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_detail_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_mediafiles_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_metadata_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_relations_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_request_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_request_policy_v2.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/mediafile_derivatives_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/mediafile_download_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/multi_tenant_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/tenant_request_policy.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/helpers.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/policies/tenant_id_resolver.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/schemas.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/util.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody/validator.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody.egg-info/SOURCES.txt +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody.egg-info/dependency_links.txt +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody.egg-info/requires.txt +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/elody.egg-info/top_level.txt +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/tests/__init_.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/tests/data.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/tests/unit/__init__.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/tests/unit/test_csv.py +0 -0
- {elody-0.0.164 → elody-0.0.166}/src/tests/unit/test_utils.py +0 -0
|
@@ -30,8 +30,20 @@ class Client:
|
|
|
30
30
|
)
|
|
31
31
|
return self.__handle_response(response, "Failed to create mediafile", "text")
|
|
32
32
|
|
|
33
|
-
def create_mediafile_with_filename(
|
|
34
|
-
|
|
33
|
+
def create_mediafile_with_filename(
|
|
34
|
+
self,
|
|
35
|
+
filename,
|
|
36
|
+
technical_origin="original",
|
|
37
|
+
original_filename=None,
|
|
38
|
+
institution_id=None,
|
|
39
|
+
):
|
|
40
|
+
original_filename = original_filename or filename
|
|
41
|
+
data = {
|
|
42
|
+
"filename": filename,
|
|
43
|
+
"original_filename": original_filename,
|
|
44
|
+
"type": "mediafile",
|
|
45
|
+
"technical_origin": technical_origin,
|
|
46
|
+
}
|
|
35
47
|
if institution_id:
|
|
36
48
|
data.update({"metadata": [{"key": "institution", "value": institution_id}]})
|
|
37
49
|
req = requests.post(
|
|
@@ -253,7 +253,9 @@ class CSVMultiObject(CSVParser):
|
|
|
253
253
|
# Map the metadata field to a unified key if applicable
|
|
254
254
|
metadata_info = self.metadata_field_mapping.get(key, {})
|
|
255
255
|
if metadata_info.get("target") == type or not metadata_info:
|
|
256
|
-
case_insensitive = metadata_info.get(
|
|
256
|
+
case_insensitive = metadata_info.get(
|
|
257
|
+
"case_insensitive", False
|
|
258
|
+
)
|
|
257
259
|
metadata_key = metadata_info.get("map_to", key)
|
|
258
260
|
indexed_dict[type][id].setdefault("metadata", list())
|
|
259
261
|
options = metadata_info.get("value_options")
|
|
@@ -289,11 +291,16 @@ class CSVMultiObject(CSVParser):
|
|
|
289
291
|
for object in objects.values():
|
|
290
292
|
if "metadata" not in object:
|
|
291
293
|
object["metadata"] = []
|
|
292
|
-
if not any(
|
|
294
|
+
if not any(
|
|
295
|
+
metadata.get("key") == required_key
|
|
296
|
+
for metadata in object["metadata"]
|
|
297
|
+
):
|
|
293
298
|
if required_value is not None:
|
|
294
|
-
metadata_object = self._get_metadata_object(
|
|
299
|
+
metadata_object = self._get_metadata_object(
|
|
300
|
+
required_key, required_value
|
|
301
|
+
)
|
|
295
302
|
else:
|
|
296
|
-
raise ColumnNotFoundException(required_key)
|
|
303
|
+
raise ColumnNotFoundException(required_key)
|
|
297
304
|
object["metadata"].append(metadata_object)
|
|
298
305
|
|
|
299
306
|
def __validate_indexed_dict(self, indexed_dict):
|
|
@@ -229,6 +229,8 @@ def __item_value_in_values(flat_item, key, values: list, flat_request_body: dict
|
|
|
229
229
|
|
|
230
230
|
try:
|
|
231
231
|
item_value = flat_request_body.get(key, flat_item[key])
|
|
232
|
+
if is_optional:
|
|
233
|
+
negate_condition = False
|
|
232
234
|
except KeyError:
|
|
233
235
|
if not is_optional:
|
|
234
236
|
raise Exception(
|
|
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.164 → elody-0.0.166}/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
|
|
File without changes
|
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/filter_generic_objects_policy.py
RENAMED
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_detail_policy.py
RENAMED
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_mediafiles_policy.py
RENAMED
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_metadata_policy.py
RENAMED
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_relations_policy.py
RENAMED
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_request_policy.py
RENAMED
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/generic_object_request_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/src/elody/policies/authorization/mediafile_derivatives_policy.py
RENAMED
|
File without changes
|
{elody-0.0.164 → elody-0.0.166}/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
|