oarepo-runtime 1.5.30__py3-none-any.whl → 1.5.32__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.
@@ -68,11 +68,14 @@ def prepare_cf_indices():
68
68
  service: RecordService
69
69
  for service in current_service_registry._services.values():
70
70
  config: RecordServiceConfig = service.config
71
- prepare_cf_index(config)
71
+ record_class = getattr(config, "record_cls", None)
72
+ if record_class:
73
+ prepare_cf_index(record_class, config)
74
+ parent_class = getattr(record_class, "parent_record_cls", None)
75
+ prepare_cf_index(parent_class, config)
72
76
 
73
77
 
74
- def prepare_cf_index(config: RecordServiceConfig):
75
- record_class = getattr(config, "record_cls", None)
78
+ def prepare_cf_index(record_class, config):
76
79
  if not record_class:
77
80
  return
78
81
 
@@ -6,6 +6,11 @@ from invenio_records_resources.services.records.results import (
6
6
  )
7
7
 
8
8
 
9
+ class ResultsComponent:
10
+ def update_data(self, identity, record, projection, expand):
11
+ raise NotImplementedError
12
+
13
+
9
14
  class RecordItem(BaseRecordItem):
10
15
  """Single record result."""
11
16
 
@@ -17,7 +22,12 @@ class RecordItem(BaseRecordItem):
17
22
  return self._data
18
23
  _data = super().data
19
24
  for c in self.components:
20
- c.update_data(self._identity, self._record, _data)
25
+ c.update_data(
26
+ identity=self._identity,
27
+ record=self._record,
28
+ projection=_data,
29
+ expand=self._expand,
30
+ )
21
31
  return _data
22
32
 
23
33
 
@@ -47,6 +57,12 @@ class RecordList(BaseRecordList):
47
57
  projection["links"] = self._links_item_tpl.expand(
48
58
  self._identity, record
49
59
  )
60
+ # todo optimization viz FieldsResolver
50
61
  for c in self.components:
51
- c.update_data(self._identity, record, projection)
62
+ c.update_data(
63
+ identity=self._identity,
64
+ record=self._record,
65
+ projection=projection,
66
+ expand=self._expand,
67
+ )
52
68
  yield projection
@@ -124,6 +124,7 @@ if False: # NOSONAR
124
124
 
125
125
 
126
126
  class InvenioUISchema(ma.Schema):
127
+ _schema = ma.fields.Str(attribute="$schema", data_key="$schema")
127
128
  id = ma.fields.Str()
128
129
  created = LocalizedDateTime(dump_only=True)
129
130
  updated = LocalizedDateTime(dump_only=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oarepo-runtime
3
- Version: 1.5.30
3
+ Version: 1.5.32
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -70,13 +70,13 @@ oarepo_runtime/resources/localized_ui_json_serializer.py,sha256=3V9cJaG_e1PMXKVX
70
70
  oarepo_runtime/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
71
  oarepo_runtime/services/components.py,sha256=9wt9CmoCFA8Utbb8eNA-Mvzo5LCApHT9zHpWIWZNyXY,1506
72
72
  oarepo_runtime/services/generators.py,sha256=V582uA813AIXnFhzqUwakmDgBOI1SQe3XZeJtUXNbwM,872
73
- oarepo_runtime/services/results.py,sha256=F3A0U3MRUOYlxNglJPQeGMKdD8QNq1il106jQZ0c9gQ,1499
73
+ oarepo_runtime/services/results.py,sha256=gcITj-bWPwrGdNGGEiNWroRC-JLUoBaZbAMOZeDrQRg,1955
74
74
  oarepo_runtime/services/search.py,sha256=ywfwGH7oAM44WeOSjlIsY_qoCMZJ1TlTLd_NgE2ow3Y,5296
75
75
  oarepo_runtime/services/config/__init__.py,sha256=SCqww5sV8qh3gmev6TE8EyJbD58juIEDCm_7MEHxtSg,440
76
76
  oarepo_runtime/services/config/permissions_presets.py,sha256=zApeA-2DYAlD--SzVz3vq_OFjq48Ko0pe08e4o2vxr4,6114
77
77
  oarepo_runtime/services/config/service.py,sha256=2aq5jobPH22T1QqlJDommvAxJwo9aQGiqK5q-k-l9CA,4668
78
78
  oarepo_runtime/services/custom_fields/__init__.py,sha256=xJ7XEyMJHPfIgX5JKpgpwh7SYc9Zee2dC5oC8cm99Qc,2282
79
- oarepo_runtime/services/custom_fields/mappings.py,sha256=1mb8nYeUlQxbBolsKURGKUIpIV1NDb-7Mcur32jjIjg,4433
79
+ oarepo_runtime/services/custom_fields/mappings.py,sha256=CYJJAGo4k6Bv6D5FLy4Js9EjhWWNThJBkosAMdZIXzI,4600
80
80
  oarepo_runtime/services/expansions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
81
  oarepo_runtime/services/expansions/expandable_fields.py,sha256=7DWKFL6ml8J7zGI6wm9LO7Xd6R0LSylsuq4lyRumNHQ,745
82
82
  oarepo_runtime/services/expansions/service.py,sha256=HaEy76XOhDf__sQ91hi-8iH1hthM9q07pRhOmyZyVrs,144
@@ -102,7 +102,7 @@ oarepo_runtime/services/schema/i18n_validation.py,sha256=fyMTi2Rw-KiHv7c7HN61zGx
102
102
  oarepo_runtime/services/schema/marshmallow.py,sha256=LmcSxvbZ9jIhkNHCqqxt1SA2UNijoDmIzqli1MkoTrE,1153
103
103
  oarepo_runtime/services/schema/oneofschema.py,sha256=X_pXzrkYcLGGAtGN1qltrz45OzD_atrJHkHkp3L01xg,6660
104
104
  oarepo_runtime/services/schema/polymorphic.py,sha256=f9yC7MGVynAFGM0fXIq0NbqGJxI65Xpi8GaM2ZM4c6Q,561
105
- oarepo_runtime/services/schema/ui.py,sha256=caRca4vuUVoLew3gkhbPQYGaLXB8C67E5jxz45-9zkE,3663
105
+ oarepo_runtime/services/schema/ui.py,sha256=qDR-nukJmeLwDZCdqcBg3CbseQ_A_BdxXyt_R4Qc_2c,3732
106
106
  oarepo_runtime/services/schema/validation.py,sha256=fahqKGDdIYWux5ZeoljrEe8VD2fDZR9VpfvYmTYAmpw,1050
107
107
  oarepo_runtime/translations/default_translations.py,sha256=060GBlA1ghWxfeumo6NqxCCZDb-6OezOuF6pr-_GEOQ,104
108
108
  oarepo_runtime/translations/jinjax_messages.jinja,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -115,9 +115,9 @@ oarepo_runtime/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
115
115
  oarepo_runtime/utils/functools.py,sha256=gKS9YZtlIYcDvdNA9cmYO00yjiXBYV1jg8VpcRUyQyg,1324
116
116
  oarepo_runtime/utils/path.py,sha256=V1NVyk3m12_YLbj7QHYvUpE1wScO78bYsX1LOLeXDkI,3108
117
117
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
118
- oarepo_runtime-1.5.30.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
119
- oarepo_runtime-1.5.30.dist-info/METADATA,sha256=-RxYSie_VM-QdwV_3we-zToS-EeWEmGaYgG4HYVaOvw,4680
120
- oarepo_runtime-1.5.30.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
121
- oarepo_runtime-1.5.30.dist-info/entry_points.txt,sha256=QrlXAKuPDVBinaSh_v3yO9_Nb9ZNmJCJ0VFcCW-z0Jg,327
122
- oarepo_runtime-1.5.30.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
123
- oarepo_runtime-1.5.30.dist-info/RECORD,,
118
+ oarepo_runtime-1.5.32.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
119
+ oarepo_runtime-1.5.32.dist-info/METADATA,sha256=_PPldeHNddy89KosMLaNCm1xzAEjET1eHnno3M-31PU,4680
120
+ oarepo_runtime-1.5.32.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
121
+ oarepo_runtime-1.5.32.dist-info/entry_points.txt,sha256=QrlXAKuPDVBinaSh_v3yO9_Nb9ZNmJCJ0VFcCW-z0Jg,327
122
+ oarepo_runtime-1.5.32.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
123
+ oarepo_runtime-1.5.32.dist-info/RECORD,,