oarepo-runtime 2.0.0.dev31__py3-none-any.whl → 2.0.0.dev33__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.
@@ -19,6 +19,6 @@ from .api import Model
19
19
  from .ext import OARepoRuntime
20
20
  from .proxies import current_runtime
21
21
 
22
- __version__ = "2.0.0dev31"
22
+ __version__ = "2.0.0dev33"
23
23
 
24
24
  __all__ = ("Model", "OARepoRuntime", "__version__", "current_runtime")
@@ -11,6 +11,8 @@
11
11
 
12
12
  from __future__ import annotations
13
13
 
14
+ from typing import Any, override
15
+
14
16
  from invenio_records_resources.services.base.links import EndpointLink
15
17
 
16
18
 
@@ -29,15 +31,27 @@ def rdm_pagination_record_endpoint_links(endpoint: str, params: list[str] | None
29
31
  called "id" instead of "pid_value". That is why this function is called rdm_...
30
32
  """
31
33
  params = [*(params or []), "pid_value"]
34
+
35
+ class RecordEndpointLinkWithId(EndpointLink):
36
+ @override
37
+ @staticmethod
38
+ def vars(obj: Any, vars: dict[str, Any]) -> None:
39
+ pid_value = vars.pop("id", None)
40
+ if pid_value is not None:
41
+ vars["pid_value"] = pid_value
42
+
32
43
  return {
33
- "prev": EndpointLink(
44
+ "prev": RecordEndpointLinkWithId(
34
45
  endpoint,
35
46
  when=lambda pagination, _ctx: pagination.has_prev,
36
47
  vars=lambda pagination, _vars: _vars["args"].update({"page": pagination.prev_page.page}),
37
48
  params=params,
38
49
  ),
39
- "self": EndpointLink(endpoint, params=params),
40
- "next": EndpointLink(
50
+ "self": RecordEndpointLinkWithId(
51
+ endpoint,
52
+ params=params,
53
+ ),
54
+ "next": RecordEndpointLinkWithId(
41
55
  endpoint,
42
56
  when=lambda pagination, _ctx: pagination.has_next,
43
57
  vars=lambda pagination, _vars: _vars["args"].update({"page": pagination.next_page.page}),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oarepo-runtime
3
- Version: 2.0.0.dev31
3
+ Version: 2.0.0.dev33
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Project-URL: Homepage, https://github.com/oarepo/oarepo-runtime
6
6
  License-Expression: MIT
@@ -1,4 +1,4 @@
1
- oarepo_runtime/__init__.py,sha256=kswOtKLkeTENZ1q_4do3W0XvIcgjL7ZEe6rxHa7M5Gg,686
1
+ oarepo_runtime/__init__.py,sha256=Yyknq93rocqlDSiPoWRbMXKm60R9oaLNgvJ3nO3ABMY,686
2
2
  oarepo_runtime/api.py,sha256=tLPgKv1iao2ZeL0tTJeA85019_sMW_dQAleayOeXjgI,14200
3
3
  oarepo_runtime/config.py,sha256=RUEPFn_5bKp9Wb0OY-Fb3VK30m35vF5IsLjYaQHhP3g,3838
4
4
  oarepo_runtime/ext.py,sha256=NgiRNl_hwTvEWcXnNwVh_XCPJyvwr3dZkdPmkWvN1xo,8785
@@ -35,14 +35,14 @@ oarepo_runtime/services/facets/params.py,sha256=8ZFDeTUPDV3d9cdIIECo5F38KQ28h1eG
35
35
  oarepo_runtime/services/facets/utils.py,sha256=z4RcBqM4_QfTSMY-mf8yhL18bhHg5XwzHmqV6mLtzvs,2251
36
36
  oarepo_runtime/services/records/__init__.py,sha256=Mpohx3xEXTmoodTEHbCih6I97JIofgqa_bf_Ysq4e2g,446
37
37
  oarepo_runtime/services/records/custom_fields.py,sha256=Yp3WsLYq1_OPMmJvpxCDtZi9IhuxHsBFPor8q901qn0,1417
38
- oarepo_runtime/services/records/links.py,sha256=XzO8zEV7GgbkrhX98x9aq4Jn5v5yWAsh2Gy8rjDcCw0,2729
38
+ oarepo_runtime/services/records/links.py,sha256=KUuRpsH0Mijn5EVSRTqUwIUPTRMv1a7oHIQ6-27UJFk,3113
39
39
  oarepo_runtime/services/records/mapping.py,sha256=y3oeToKEnaRYpMV3q2-2cXNzyzyL3XXGvY26BifybpE,1332
40
40
  oarepo_runtime/services/schema/__init__.py,sha256=jgAPI_uKC6Ug4KQWnwQVg3-aNaw-eHja323AUFo5ELo,351
41
41
  oarepo_runtime/services/schema/i18n.py,sha256=9D1zOQaPKAnYzejB0vO-m2BJYnam0N0Lrq4jID7twfE,3174
42
42
  oarepo_runtime/services/schema/i18n_ui.py,sha256=DbusphhGDeaobTt4nuwNgKZ6Houlu4Sv3SuMGkdjRRY,3582
43
43
  oarepo_runtime/services/schema/ui.py,sha256=Y_jBO-fowkpOgceWz8aqJSJAUiAnKLGSIuNpjNLnp8Q,4612
44
- oarepo_runtime-2.0.0.dev31.dist-info/METADATA,sha256=P9qthmoamo_Dr8eSQJQ8LYfvxbQgw9mwTO2wDiqQoM0,4723
45
- oarepo_runtime-2.0.0.dev31.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
- oarepo_runtime-2.0.0.dev31.dist-info/entry_points.txt,sha256=rOfs8R1oXFN_dLH9zAZ6ydkvr83mDajegc6NBIRsCMQ,318
47
- oarepo_runtime-2.0.0.dev31.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
48
- oarepo_runtime-2.0.0.dev31.dist-info/RECORD,,
44
+ oarepo_runtime-2.0.0.dev33.dist-info/METADATA,sha256=I1Ojqa6TlUdZEkdhaG4i8CqqzQzvU_ZemZoPGFLLmfk,4723
45
+ oarepo_runtime-2.0.0.dev33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
+ oarepo_runtime-2.0.0.dev33.dist-info/entry_points.txt,sha256=rOfs8R1oXFN_dLH9zAZ6ydkvr83mDajegc6NBIRsCMQ,318
47
+ oarepo_runtime-2.0.0.dev33.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
48
+ oarepo_runtime-2.0.0.dev33.dist-info/RECORD,,