das-cli 1.2.30__tar.gz → 1.2.31__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.
- {das_cli-1.2.30/das_cli.egg-info → das_cli-1.2.31}/PKG-INFO +1 -1
- {das_cli-1.2.30 → das_cli-1.2.31}/das/managers/entries_manager.py +25 -14
- {das_cli-1.2.30 → das_cli-1.2.31/das_cli.egg-info}/PKG-INFO +1 -1
- {das_cli-1.2.30 → das_cli-1.2.31}/pyproject.toml +1 -1
- {das_cli-1.2.30 → das_cli-1.2.31}/tests/entries_manager_test.py +8 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/LICENSE +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/MANIFEST.in +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/README.md +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/__init__.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/ai/plugins/dasai.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/ai/plugins/entries/entries_plugin.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/app.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/authentication/auth.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/authentication/secure_input.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/cli.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/common/api.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/common/config.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/common/entry_fields_constants.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/common/enums.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/common/file_utils.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/managers/__init__.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/managers/digital_objects_manager.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/managers/download_manager.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/managers/search_manager.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/attributes.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/cache.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/digital_objects.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/downloads.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/entries.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/entry_fields.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/hangfire.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/search.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/service_base.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das/services/users.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das_cli.egg-info/SOURCES.txt +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das_cli.egg-info/dependency_links.txt +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das_cli.egg-info/entry_points.txt +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das_cli.egg-info/requires.txt +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/das_cli.egg-info/top_level.txt +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/setup.cfg +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/tests/__init__.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/tests/attributes_test.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/tests/download_manager_test.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/tests/entries_service_test.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/tests/entries_test.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/tests/file_utils_test.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/tests/run_tests.py +0 -0
- {das_cli-1.2.30 → das_cli-1.2.31}/tests/search_manager_test.py +0 -0
|
@@ -125,6 +125,9 @@ class EntryManager:
|
|
|
125
125
|
if (entry_raw.get("lastmodificationtime") is not None):
|
|
126
126
|
entry["Updated At"] = entry_raw.get("lastmodificationtime")
|
|
127
127
|
|
|
128
|
+
if not 'attributeId' in entry:
|
|
129
|
+
entry['attributeId'] = entry_response.get('attributeId')
|
|
130
|
+
|
|
128
131
|
return entry
|
|
129
132
|
except Exception as e:
|
|
130
133
|
raise ValueError(f"Error processing entry data: {e}")
|
|
@@ -596,25 +599,33 @@ class EntryManager:
|
|
|
596
599
|
return self.entry_service.chown(new_user_id=user.get('id'), entry_list_ids=entry_list_ids)
|
|
597
600
|
|
|
598
601
|
|
|
599
|
-
def get_direct_relations(self,
|
|
602
|
+
def get_direct_relations(self,
|
|
603
|
+
entry_code: str = None,
|
|
604
|
+
entry_id: str = None,
|
|
605
|
+
query_string: str = "",
|
|
606
|
+
sorting: str = "",
|
|
607
|
+
max_result_count: int = 100,
|
|
608
|
+
skip_count: int = 0):
|
|
600
609
|
"""
|
|
601
610
|
Get the direct relations for an entry.
|
|
602
611
|
"""
|
|
603
|
-
if not attribute_id:
|
|
604
|
-
raise ValueError("Attribute ID is required")
|
|
605
|
-
if not entry_id:
|
|
606
|
-
raise ValueError("Entry ID is required")
|
|
607
|
-
if not query_string:
|
|
608
|
-
raise ValueError("Query string is required")
|
|
609
612
|
|
|
610
|
-
if not
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
613
|
+
if not entry_code and not entry_id:
|
|
614
|
+
raise ValueError("Entry code or ID is required")
|
|
615
|
+
|
|
616
|
+
if entry_code:
|
|
617
|
+
entry = self.get(code=entry_code)
|
|
618
|
+
entry_id = entry.get('ID') if entry.get('ID') else entry.get('id')
|
|
619
|
+
else:
|
|
620
|
+
entry = self.get(id=entry_id)
|
|
621
|
+
|
|
622
|
+
if entry is None:
|
|
623
|
+
raise ValueError("Entry not found")
|
|
616
624
|
|
|
617
|
-
return self.entry_service.get_direct_relations(
|
|
625
|
+
return self.entry_service.get_direct_relations(
|
|
626
|
+
attribute_id=entry.get('attributeId'),
|
|
627
|
+
entry_id=entry.get('ID') if entry.get('ID') else entry.get('id'),
|
|
628
|
+
query_string=query_string, sorting=sorting, max_result_count=max_result_count, skip_count=skip_count)
|
|
618
629
|
|
|
619
630
|
if __name__ == "__main__":
|
|
620
631
|
manager = EntryManager()
|
|
@@ -433,4 +433,12 @@ class TestEntriesManager(unittest.TestCase):
|
|
|
433
433
|
self.assertNotIn("\"code\":", message, "Error message should not be a raw JSON string")
|
|
434
434
|
|
|
435
435
|
|
|
436
|
+
def test_get_direct_relations(self):
|
|
437
|
+
"""Test getting the direct relations for an entry"""
|
|
438
|
+
direct_relations = self.entry_manager.get_direct_relations(entry_code="6.b.sy")
|
|
439
|
+
self.assertIsNotNone(direct_relations)
|
|
440
|
+
self.assertGreater(len(direct_relations), 0)
|
|
441
|
+
self.assertRegex(direct_relations.get('items')[0].get('id'), r'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')
|
|
442
|
+
|
|
443
|
+
|
|
436
444
|
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|