oarepo-runtime 1.5.132__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.
- oarepo_runtime/datastreams/writers/service.py +1 -1
- oarepo_runtime/services/schema/rdm.py +34 -7
- {oarepo_runtime-1.5.132.dist-info → oarepo_runtime-1.5.134.dist-info}/METADATA +1 -1
- {oarepo_runtime-1.5.132.dist-info → oarepo_runtime-1.5.134.dist-info}/RECORD +8 -8
- {oarepo_runtime-1.5.132.dist-info → oarepo_runtime-1.5.134.dist-info}/WHEEL +1 -1
- {oarepo_runtime-1.5.132.dist-info → oarepo_runtime-1.5.134.dist-info}/entry_points.txt +0 -0
- {oarepo_runtime-1.5.132.dist-info → oarepo_runtime-1.5.134.dist-info}/licenses/LICENSE +0 -0
- {oarepo_runtime-1.5.132.dist-info → oarepo_runtime-1.5.134.dist-info}/top_level.txt +0 -0
@@ -64,7 +64,7 @@ class ServiceWriter(BaseWriter):
|
|
64
64
|
return None
|
65
65
|
|
66
66
|
def _get_stream_entry_id(self, entry: StreamEntry):
|
67
|
-
return entry.id
|
67
|
+
return entry.id or entry.entry.get("id")
|
68
68
|
|
69
69
|
def write(self, batch: StreamBatch):
|
70
70
|
"""Writes the input entry using the given service."""
|
@@ -1,14 +1,19 @@
|
|
1
|
-
|
1
|
+
from functools import partial
|
2
2
|
|
3
|
-
|
4
|
-
from
|
5
|
-
from
|
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.
|
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
|
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
|
+
)
|
@@ -42,7 +42,7 @@ oarepo_runtime/datastreams/writers/__init__.py,sha256=PWufWNrixFhXv5wSv3_pzmrimr
|
|
42
42
|
oarepo_runtime/datastreams/writers/attachments_file.py,sha256=kV_IPAWawJ9PX-IfoncmLQXpdTbzRMsJie8uKX1vNp0,3161
|
43
43
|
oarepo_runtime/datastreams/writers/attachments_service.py,sha256=g_tbjUA3YnTE5gP21zlG2kIxneZsn0q95EVjlxB8s1M,4152
|
44
44
|
oarepo_runtime/datastreams/writers/publish.py,sha256=x_ipun8TQiYNvGokVnEppYw9ko1AyrSzHu3D8b3ZWzI,2126
|
45
|
-
oarepo_runtime/datastreams/writers/service.py,sha256=
|
45
|
+
oarepo_runtime/datastreams/writers/service.py,sha256=8oXGG365ro_XEoZUncFltule_6TAbPPbSr-SBgcbWRA,6224
|
46
46
|
oarepo_runtime/datastreams/writers/utils.py,sha256=Lk_ZLNeXTLuFEn04lw1-6bJ7duG6kwA8X4wf9c_GiL4,1067
|
47
47
|
oarepo_runtime/datastreams/writers/validation_errors.py,sha256=wOCXdniR6so_4ExpdFYYgBRyENp7_6kVFZM2L-Hy3G8,661
|
48
48
|
oarepo_runtime/datastreams/writers/yaml.py,sha256=XchUJHQ58E2Mfgs8elImXbL38jFtI8Hfoye6yaR0gKI,1482
|
@@ -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=
|
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.
|
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.
|
156
|
-
oarepo_runtime-1.5.
|
157
|
-
oarepo_runtime-1.5.
|
158
|
-
oarepo_runtime-1.5.
|
159
|
-
oarepo_runtime-1.5.
|
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,,
|
File without changes
|
File without changes
|
File without changes
|