oarepo-runtime 1.5.105__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.
@@ -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
- if hasattr(pid_field_context, "pid_type"):
16
- pid_type = pid_field_context.pid_type
17
- else:
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
- pid_type = (
20
- pid_field._provider.pid_type
21
- if pid_field._provider
22
- else pid_field._pid_type
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.",
@@ -31,5 +31,5 @@ class MultilingualAwardSchema(AwardRelationSchema):
31
31
  class FundingSchema(ma.Schema):
32
32
  """Funding schema."""
33
33
 
34
- funder = fields.Nested(FunderRelationSchema, required=True)
35
- award = fields.Nested(MultilingualAwardSchema)
34
+ funder = ma_fields.Nested(FunderRelationSchema, required=True)
35
+ award = ma_fields.Nested(MultilingualAwardSchema)
@@ -33,7 +33,7 @@ class RDMFunderVocabularyUISchema(DictOnlySchema):
33
33
 
34
34
  name = VocabularyI18nStrUIField()
35
35
 
36
- identifier = ma.fields.Nested(RDMIdentifierWithSchemaUISchema())
36
+ identifiers = ma.fields.List(ma.fields.Nested(RDMIdentifierWithSchemaUISchema()))
37
37
 
38
38
 
39
39
  class RDMRoleVocabularyUISchema(DictOnlySchema):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: oarepo-runtime
3
- Version: 1.5.105
3
+ Version: 1.5.107
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -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=jKiwUEepJkOc0MRX3Etl5RQJw3t40rY7FOJCIPwOKmg,2932
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
@@ -126,8 +126,8 @@ oarepo_runtime/services/schema/marshmallow.py,sha256=iAMMH5MlYs59qetXAHOROvERNSc
126
126
  oarepo_runtime/services/schema/marshmallow_to_json_schema.py,sha256=VYLnVWHOoaxWCD_gqJO8-8u1SbaPEFBjDZ5HGgGr0Ow,2027
127
127
  oarepo_runtime/services/schema/oneofschema.py,sha256=GnWH4Or_G5M0NgSmCoqMI6PBrJg5AC9RHrcB5QDKRq0,6661
128
128
  oarepo_runtime/services/schema/polymorphic.py,sha256=bAbUoTIeDBiJPYPhpLEKKZekEdkHlpqkmNxk1hN3PDw,564
129
- oarepo_runtime/services/schema/rdm.py,sha256=ckcv_imYCG56_qwxVDZCt04D0tvI8I--NLHQU6iTwVc,1242
130
- oarepo_runtime/services/schema/rdm_ui.py,sha256=Vs9kOaQ0ZPPZpSqEXlu0vQrt-458Aci9u9T4YONSJLs,3026
129
+ oarepo_runtime/services/schema/rdm.py,sha256=BDmjWrBQmBN4QbQE9t7EUNUuZ4uCtAAtJ0bQvJWQLtc,1249
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.105.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
147
- oarepo_runtime-1.5.105.dist-info/METADATA,sha256=81-KfaOYNSYy_lY27QN7I2OahhNmt9osw3WPKfv-s3o,4721
148
- oarepo_runtime-1.5.105.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
149
- oarepo_runtime-1.5.105.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
150
- oarepo_runtime-1.5.105.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
151
- oarepo_runtime-1.5.105.dist-info/RECORD,,
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,,