oarepo-runtime 1.6.2__py3-none-any.whl → 1.7.1__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,8 +1,10 @@
1
- from invenio_pidstore.errors import PIDUnregistered
1
+ from invenio_pidstore.errors import PIDUnregistered, PIDDoesNotExistError
2
2
  from invenio_records_resources.references.entity_resolvers.records import (
3
3
  RecordProxy as InvenioRecordProxy,
4
4
  )
5
5
  from sqlalchemy.exc import NoResultFound
6
+ from invenio_access.permissions import system_identity
7
+ from invenio_records_resources.references.entity_resolvers.results import ServiceResultProxy as InvenioServiceResultProxy
6
8
 
7
9
 
8
10
  def set_field(result, resolved_dict, field_name):
@@ -35,6 +37,15 @@ class RecordProxy(InvenioRecordProxy):
35
37
  },
36
38
  }
37
39
 
40
+ class WithDeletedServiceResultProxy(InvenioServiceResultProxy):
41
+ """Resolver proxy for a result item entity."""
42
+
43
+ def _resolve(self):
44
+ """Resolve the result item from the proxy's reference dict."""
45
+ id_ = self._parse_ref_dict_id()
46
+ # TODO: Make identity customizable
47
+ return self.service.read(system_identity, id_, include_deleted=True).to_dict()
48
+
38
49
 
39
50
  class DraftProxy(RecordProxy):
40
51
  def _resolve(self):
@@ -15,6 +15,8 @@ from marshmallow_utils.fields import (
15
15
  from marshmallow_utils.fields.nestedattr import NestedAttribute
16
16
  from marshmallow_utils.schemas.identifier import IdentifierSchema
17
17
 
18
+ from .i18n import MultilingualField
19
+
18
20
 
19
21
  class RDMRecordMixin(ma.Schema):
20
22
  versions = NestedAttribute(VersionsSchema, dump_only=True)
@@ -60,3 +62,14 @@ class RelatedRecordIdentifierField(IdentifierSet):
60
62
  *args,
61
63
  **kwargs
62
64
  )
65
+
66
+
67
+ class RDMSubjectSchema(ma.Schema):
68
+ """Subject ui schema."""
69
+
70
+ class Meta:
71
+ unknown = ma.RAISE
72
+
73
+ _id = ma.fields.String(data_key="id")
74
+
75
+ subject = MultilingualField()
@@ -4,6 +4,8 @@ from oarepo_vocabularies.services.ui_schema import VocabularyI18nStrUIField
4
4
 
5
5
  from oarepo_runtime.services.schema.marshmallow import DictOnlySchema
6
6
 
7
+ from .i18n_ui import MultilingualUIField
8
+
7
9
 
8
10
  class RDMIdentifierWithSchemaUISchema(ma.Schema):
9
11
  scheme = ma.fields.String(
@@ -141,3 +143,14 @@ class RDMCreatorsUISchema(ma.Schema):
141
143
  )
142
144
 
143
145
  person_or_org = ma.fields.Nested(RDMPersonOrOrganizationUISchema())
146
+
147
+
148
+ class RDMSubjectUISchema(ma.Schema):
149
+ """Subject ui schema."""
150
+
151
+ class Meta:
152
+ unknown = ma.RAISE
153
+
154
+ _id = ma.fields.String(data_key="id")
155
+
156
+ subject = MultilingualUIField()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oarepo-runtime
3
- Version: 1.6.2
3
+ Version: 1.7.1
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -60,7 +60,7 @@ oarepo_runtime/records/dumpers/__init__.py,sha256=OmzNhLdMNKibmCksnj9eTX9xPBG30d
60
60
  oarepo_runtime/records/dumpers/edtf_interval.py,sha256=8bE3JlaR7b33rxDc7LW9R8jcwNI66Zb07Jee6YUmlrE,1231
61
61
  oarepo_runtime/records/dumpers/multilingual_dumper.py,sha256=PbNFCLsiH4XV3E1v8xga_fzlcEImHy8OXn_UKh_8VBU,1090
62
62
  oarepo_runtime/records/entity_resolvers/__init__.py,sha256=UiiIT54pUu9j7qPAPfqVp4UTnXnppp0c_LtKbFnyt6Y,383
63
- oarepo_runtime/records/entity_resolvers/proxies.py,sha256=R92Cil_sTgX-sHJtdNv82yd-F3SUfsGSNCHdwI9Zfq8,1516
63
+ oarepo_runtime/records/entity_resolvers/proxies.py,sha256=P9c8JeHc25i_v8uXxTMHNlMNTFskET6dTM0VVMfLfyk,2097
64
64
  oarepo_runtime/records/mappings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  oarepo_runtime/records/mappings/rdm_parent_mapping.json,sha256=ykgVr-navpy-HlhUN78sZ1ZpcAaduzZ0ESpphLK4b5E,14233
66
66
  oarepo_runtime/records/owners/__init__.py,sha256=R4hudCBqLRRzgCnkEjXIL7hSp068z-s6YOwYSkWyuaw,93
@@ -136,8 +136,8 @@ oarepo_runtime/services/schema/marshmallow.py,sha256=iAMMH5MlYs59qetXAHOROvERNSc
136
136
  oarepo_runtime/services/schema/marshmallow_to_json_schema.py,sha256=VYLnVWHOoaxWCD_gqJO8-8u1SbaPEFBjDZ5HGgGr0Ow,2027
137
137
  oarepo_runtime/services/schema/oneofschema.py,sha256=GnWH4Or_G5M0NgSmCoqMI6PBrJg5AC9RHrcB5QDKRq0,6661
138
138
  oarepo_runtime/services/schema/polymorphic.py,sha256=bAbUoTIeDBiJPYPhpLEKKZekEdkHlpqkmNxk1hN3PDw,564
139
- oarepo_runtime/services/schema/rdm.py,sha256=TkWqtMlCosm4mL7nCHUW3RSGUQypk3wViTMwyqz2Ezs,2047
140
- oarepo_runtime/services/schema/rdm_ui.py,sha256=oXV8wGFChL84Y1xtkhZ89eZ4Ngr6RV8iavf32e4nCVI,3544
139
+ oarepo_runtime/services/schema/rdm.py,sha256=rtyO46CREmBJMQxgm0UenIbELSY6OAj35VbxFflIH_g,2272
140
+ oarepo_runtime/services/schema/rdm_ui.py,sha256=ffjl20tvRcuX3FNINOhGJWX84aTNEzJOqoKZum1s03s,3778
141
141
  oarepo_runtime/services/schema/ui.py,sha256=ff2AfK-G0fArlVHHKsDagPhu9NkMj6DPcVK4NycEO8c,8216
142
142
  oarepo_runtime/services/schema/validation.py,sha256=aRfeR-2D1XXYqI3_U5FHoFvJrYjZlpM8nB35-M_u3Qs,2300
143
143
  oarepo_runtime/translations/default_translations.py,sha256=060GBlA1ghWxfeumo6NqxCCZDb-6OezOuF6pr-_GEOQ,104
@@ -149,13 +149,13 @@ oarepo_runtime/translations/en/LC_MESSAGES/messages.po,sha256=7-5S3iINOSFSI5gVdR
149
149
  oarepo_runtime/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
150
150
  oarepo_runtime/utils/functools.py,sha256=gKS9YZtlIYcDvdNA9cmYO00yjiXBYV1jg8VpcRUyQyg,1324
151
151
  oarepo_runtime/utils/path.py,sha256=V1NVyk3m12_YLbj7QHYvUpE1wScO78bYsX1LOLeXDkI,3108
152
- oarepo_runtime-1.6.2.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
152
+ oarepo_runtime-1.7.1.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
153
153
  tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
154
154
  tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
155
155
  tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
156
156
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
157
- oarepo_runtime-1.6.2.dist-info/METADATA,sha256=KtPFsqo3VuCjIrCyQxJL7hq84SCRZzIPLBW9VeLmzQg,4788
158
- oarepo_runtime-1.6.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
159
- oarepo_runtime-1.6.2.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
160
- oarepo_runtime-1.6.2.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
161
- oarepo_runtime-1.6.2.dist-info/RECORD,,
157
+ oarepo_runtime-1.7.1.dist-info/METADATA,sha256=rvL7MLlWJ21OM6vVVDks-Ga6iqUJiqmqEZirtr1OfbA,4788
158
+ oarepo_runtime-1.7.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
159
+ oarepo_runtime-1.7.1.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
160
+ oarepo_runtime-1.7.1.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
161
+ oarepo_runtime-1.7.1.dist-info/RECORD,,