oarepo-runtime 1.5.106__py3-none-any.whl → 1.5.107__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.
- oarepo_runtime/records/relations/pid_relation.py +16 -9
- oarepo_runtime/services/schema/rdm_ui.py +1 -1
- {oarepo_runtime-1.5.106.dist-info → oarepo_runtime-1.5.107.dist-info}/METADATA +1 -1
- {oarepo_runtime-1.5.106.dist-info → oarepo_runtime-1.5.107.dist-info}/RECORD +8 -8
- {oarepo_runtime-1.5.106.dist-info → oarepo_runtime-1.5.107.dist-info}/LICENSE +0 -0
- {oarepo_runtime-1.5.106.dist-info → oarepo_runtime-1.5.107.dist-info}/WHEEL +0 -0
- {oarepo_runtime-1.5.106.dist-info → oarepo_runtime-1.5.107.dist-info}/entry_points.txt +0 -0
- {oarepo_runtime-1.5.106.dist-info → oarepo_runtime-1.5.107.dist-info}/top_level.txt +0 -0
@@ -5,22 +5,29 @@ from oarepo_runtime.services.relations.errors import InvalidRelationError
|
|
5
5
|
from .base import Relation, RelationResult
|
6
6
|
from .lookup import LookupResult
|
7
7
|
|
8
|
-
|
9
8
|
class PIDRelationResult(RelationResult):
|
10
9
|
def resolve(self, id_):
|
11
10
|
"""Resolve the value using the record class."""
|
12
11
|
# TODO: handle permissions here !!!!!!
|
13
12
|
try:
|
14
13
|
pid_field_context = self.field.pid_field
|
15
|
-
|
16
|
-
pid_type = pid_field_context
|
17
|
-
|
14
|
+
try:
|
15
|
+
pid_type = getattr(pid_field_context, "pid_type", None)
|
16
|
+
except:
|
17
|
+
pass
|
18
|
+
|
19
|
+
if pid_type is None:
|
18
20
|
pid_field = pid_field_context.field
|
19
|
-
|
20
|
-
pid_field._provider
|
21
|
-
|
22
|
-
else
|
23
|
-
|
21
|
+
if pid_field._provider:
|
22
|
+
if hasattr(pid_field._provider, "pid_type"):
|
23
|
+
pid_type = pid_field._provider.pid_type
|
24
|
+
else:
|
25
|
+
pid_type = self.field.pid_field.record_cls.__name__
|
26
|
+
else:
|
27
|
+
if hasattr(pid_field, "_pid_type"):
|
28
|
+
pid_type = pid_field._pid_type
|
29
|
+
else:
|
30
|
+
pid_type = self.field.pid_field.record_cls.__name__
|
24
31
|
except Exception as e:
|
25
32
|
raise InvalidRelationError(
|
26
33
|
f"PID type for field {self.field.key} has not been found or there was an exception accessing it.",
|
@@ -33,7 +33,7 @@ class RDMFunderVocabularyUISchema(DictOnlySchema):
|
|
33
33
|
|
34
34
|
name = VocabularyI18nStrUIField()
|
35
35
|
|
36
|
-
|
36
|
+
identifiers = ma.fields.List(ma.fields.Nested(RDMIdentifierWithSchemaUISchema()))
|
37
37
|
|
38
38
|
|
39
39
|
class RDMRoleVocabularyUISchema(DictOnlySchema):
|
@@ -65,7 +65,7 @@ oarepo_runtime/records/relations/__init__.py,sha256=bDAgxl_LdKsqpGG3qluxAkQnn5u2
|
|
65
65
|
oarepo_runtime/records/relations/base.py,sha256=XQpRt6-MfIKIClZ0IoGJr0GGl2Ru3RcqMoowOxrFG_E,8981
|
66
66
|
oarepo_runtime/records/relations/internal.py,sha256=OTp8iJqyl80sWDk0Q0AK42l6UsxZDABspVU_GwWza9o,1556
|
67
67
|
oarepo_runtime/records/relations/lookup.py,sha256=wi3jPfOedazOmhOMrgu50PUETc1jfSdpmjK0wvOFsEM,848
|
68
|
-
oarepo_runtime/records/relations/pid_relation.py,sha256=
|
68
|
+
oarepo_runtime/records/relations/pid_relation.py,sha256=G8ahoiQgp-PFPjQq0Fqu81z5YM7YKs8e2Hd_xqr3G8U,3290
|
69
69
|
oarepo_runtime/records/systemfields/__init__.py,sha256=LL1R64RUakA_4r0IkTq9MtwqD5eV-AQaj5u96zkWa74,533
|
70
70
|
oarepo_runtime/records/systemfields/featured_file.py,sha256=MbSaYR130_o5S9gEOblnChq-PVK4xGPGpSCrzwG3cwc,1720
|
71
71
|
oarepo_runtime/records/systemfields/has_draftcheck.py,sha256=4JkMEefPLpqtPtlTgK3UT0KzTRgyw5_Qtkss2qcz5xk,1643
|
@@ -127,7 +127,7 @@ oarepo_runtime/services/schema/marshmallow_to_json_schema.py,sha256=VYLnVWHOoaxW
|
|
127
127
|
oarepo_runtime/services/schema/oneofschema.py,sha256=GnWH4Or_G5M0NgSmCoqMI6PBrJg5AC9RHrcB5QDKRq0,6661
|
128
128
|
oarepo_runtime/services/schema/polymorphic.py,sha256=bAbUoTIeDBiJPYPhpLEKKZekEdkHlpqkmNxk1hN3PDw,564
|
129
129
|
oarepo_runtime/services/schema/rdm.py,sha256=BDmjWrBQmBN4QbQE9t7EUNUuZ4uCtAAtJ0bQvJWQLtc,1249
|
130
|
-
oarepo_runtime/services/schema/rdm_ui.py,sha256=
|
130
|
+
oarepo_runtime/services/schema/rdm_ui.py,sha256=zXdaS6-YUaIcTkZDustqLufoHtpVKp5PcgUnwgJ0skE,3043
|
131
131
|
oarepo_runtime/services/schema/ui.py,sha256=hHbj1S-DW1WqgYX31f6UjarY4wrE-qFLpH3oUhvGLyE,6192
|
132
132
|
oarepo_runtime/services/schema/validation.py,sha256=VFOKSxQLHwFb7bW8BJAFXWe_iTAZFOfqOnb2Ko_Yxxc,2085
|
133
133
|
oarepo_runtime/translations/default_translations.py,sha256=060GBlA1ghWxfeumo6NqxCCZDb-6OezOuF6pr-_GEOQ,104
|
@@ -143,9 +143,9 @@ tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
143
143
|
tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
|
144
144
|
tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
|
145
145
|
tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
146
|
-
oarepo_runtime-1.5.
|
147
|
-
oarepo_runtime-1.5.
|
148
|
-
oarepo_runtime-1.5.
|
149
|
-
oarepo_runtime-1.5.
|
150
|
-
oarepo_runtime-1.5.
|
151
|
-
oarepo_runtime-1.5.
|
146
|
+
oarepo_runtime-1.5.107.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
|
147
|
+
oarepo_runtime-1.5.107.dist-info/METADATA,sha256=Z_a-shCynRJPgujCqljVNhXARmPVt8Q6lcJ1Eexd_oQ,4721
|
148
|
+
oarepo_runtime-1.5.107.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
149
|
+
oarepo_runtime-1.5.107.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
|
150
|
+
oarepo_runtime-1.5.107.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
|
151
|
+
oarepo_runtime-1.5.107.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|