oarepo-runtime 1.5.133__py3-none-any.whl → 1.5.134__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.
@@ -1,14 +1,19 @@
1
- import marshmallow as ma
1
+ from functools import partial
2
2
 
3
- from marshmallow import fields as ma_fields
4
- from marshmallow import pre_load
5
- from marshmallow_utils.fields.nestedattr import NestedAttribute
6
- from invenio_rdm_records.services.schemas.versions import VersionsSchema
3
+ import marshmallow as ma
4
+ from invenio_i18n.selectors import get_locale
5
+ from invenio_rdm_records.services.schemas.metadata import record_identifiers_schemes
7
6
  from invenio_rdm_records.services.schemas.tombstone import DeletionStatusSchema
8
- from invenio_rdm_records.services.schemas.access import AccessSchema
7
+ from invenio_rdm_records.services.schemas.versions import VersionsSchema
9
8
  from invenio_vocabularies.contrib.awards.schema import AwardRelationSchema
10
9
  from invenio_vocabularies.contrib.funders.schema import FunderRelationSchema
11
- from invenio_i18n.selectors import get_locale
10
+ from marshmallow import fields as ma_fields
11
+ from marshmallow import pre_load
12
+ from marshmallow_utils.fields import (
13
+ IdentifierSet,
14
+ )
15
+ from marshmallow_utils.fields.nestedattr import NestedAttribute
16
+ from marshmallow_utils.schemas.identifier import IdentifierSchema
12
17
 
13
18
 
14
19
  class RDMRecordMixin(ma.Schema):
@@ -33,3 +38,25 @@ class FundingSchema(ma.Schema):
33
38
 
34
39
  funder = ma_fields.Nested(FunderRelationSchema, required=True)
35
40
  award = ma_fields.Nested(MultilingualAwardSchema)
41
+
42
+
43
+ class RecordIdentifierField(IdentifierSet):
44
+ def __init__(self, *args, **kwargs):
45
+ super().__init__(
46
+ ma.fields.Nested(
47
+ partial(IdentifierSchema, allowed_schemes=record_identifiers_schemes)
48
+ ),
49
+ *args,
50
+ **kwargs
51
+ )
52
+
53
+
54
+ class RelatedRecordIdentifierField(IdentifierSet):
55
+ def __init__(self, *args, **kwargs):
56
+ super().__init__(
57
+ ma.fields.Nested(
58
+ partial(IdentifierSchema, allowed_schemes=record_identifiers_schemes)
59
+ ),
60
+ *args,
61
+ **kwargs
62
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oarepo-runtime
3
- Version: 1.5.133
3
+ Version: 1.5.134
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -134,7 +134,7 @@ oarepo_runtime/services/schema/marshmallow.py,sha256=iAMMH5MlYs59qetXAHOROvERNSc
134
134
  oarepo_runtime/services/schema/marshmallow_to_json_schema.py,sha256=VYLnVWHOoaxWCD_gqJO8-8u1SbaPEFBjDZ5HGgGr0Ow,2027
135
135
  oarepo_runtime/services/schema/oneofschema.py,sha256=GnWH4Or_G5M0NgSmCoqMI6PBrJg5AC9RHrcB5QDKRq0,6661
136
136
  oarepo_runtime/services/schema/polymorphic.py,sha256=bAbUoTIeDBiJPYPhpLEKKZekEdkHlpqkmNxk1hN3PDw,564
137
- oarepo_runtime/services/schema/rdm.py,sha256=dBy1KCJ_XYAN_cffoRqLfQVEdZOKwmSpqGdEP4OL64k,1280
137
+ oarepo_runtime/services/schema/rdm.py,sha256=TkWqtMlCosm4mL7nCHUW3RSGUQypk3wViTMwyqz2Ezs,2047
138
138
  oarepo_runtime/services/schema/rdm_ui.py,sha256=oXV8wGFChL84Y1xtkhZ89eZ4Ngr6RV8iavf32e4nCVI,3544
139
139
  oarepo_runtime/services/schema/ui.py,sha256=ae75YON8yNGxblywCgqX2OS9ACXHGzcN_adlLKIRUYk,7937
140
140
  oarepo_runtime/services/schema/validation.py,sha256=aRfeR-2D1XXYqI3_U5FHoFvJrYjZlpM8nB35-M_u3Qs,2300
@@ -147,13 +147,13 @@ oarepo_runtime/translations/en/LC_MESSAGES/messages.po,sha256=7-5S3iINOSFSI5gVdR
147
147
  oarepo_runtime/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
148
148
  oarepo_runtime/utils/functools.py,sha256=gKS9YZtlIYcDvdNA9cmYO00yjiXBYV1jg8VpcRUyQyg,1324
149
149
  oarepo_runtime/utils/path.py,sha256=V1NVyk3m12_YLbj7QHYvUpE1wScO78bYsX1LOLeXDkI,3108
150
- oarepo_runtime-1.5.133.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
150
+ oarepo_runtime-1.5.134.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
151
151
  tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
152
152
  tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
153
153
  tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
154
154
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
155
- oarepo_runtime-1.5.133.dist-info/METADATA,sha256=HpT31VST4c_O9jumt05gjs7biJvj8L-ffv-B1KyldMw,4743
156
- oarepo_runtime-1.5.133.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
157
- oarepo_runtime-1.5.133.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
158
- oarepo_runtime-1.5.133.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
159
- oarepo_runtime-1.5.133.dist-info/RECORD,,
155
+ oarepo_runtime-1.5.134.dist-info/METADATA,sha256=ULtV0UvrWzxilo4uh30rjFK794pJswnkz1j0CJg-aKg,4743
156
+ oarepo_runtime-1.5.134.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
157
+ oarepo_runtime-1.5.134.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
158
+ oarepo_runtime-1.5.134.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
159
+ oarepo_runtime-1.5.134.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5