oarepo-runtime 2.0.0.dev34__tar.gz → 2.0.0.dev35__tar.gz
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-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/PKG-INFO +1 -1
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/__init__.py +1 -1
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/systemfields/mapping.py +2 -11
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/systemfields/publication_status.py +7 -7
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/.gitignore +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/LICENSE +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/README.md +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/api.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/cli/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/cli/search.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/config.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/ext.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/info/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/info/views.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/proxies.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/py.typed +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/drafts.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/mapping.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/pid_providers.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/systemfields/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/systemfields/base.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/systemfields/custom_fields.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/systemfields/selectors.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/resources/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/resources/config.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/config/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/config/components.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/config/link_conditions.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/config/permissions.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/base.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/date.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/nested_facet.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/params.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/utils.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/generators.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/records/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/records/custom_fields.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/records/links.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/records/mapping.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/results.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/schema/__init__.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/schema/i18n.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/schema/i18n_ui.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/schema/ui.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/typing.py +0 -0
- {oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/pyproject.toml +0 -0
@@ -10,20 +10,15 @@
|
|
10
10
|
|
11
11
|
from __future__ import annotations
|
12
12
|
|
13
|
-
from typing import TYPE_CHECKING
|
13
|
+
from typing import TYPE_CHECKING
|
14
14
|
|
15
15
|
from invenio_records.api import Record
|
16
16
|
|
17
|
-
from .base import TypedSystemField
|
18
|
-
|
19
17
|
if TYPE_CHECKING:
|
20
18
|
from invenio_records.dumpers import Dumper
|
21
|
-
from invenio_records.systemfields import SystemField
|
22
|
-
else:
|
23
|
-
SystemField = object
|
24
19
|
|
25
20
|
|
26
|
-
class MappingSystemFieldMixin[R: Record = Record
|
21
|
+
class MappingSystemFieldMixin[R: Record = Record]:
|
27
22
|
"""Mixin class that provides default mapping, mapping settings, and dynamic templates for system fields."""
|
28
23
|
|
29
24
|
@property
|
@@ -42,18 +37,14 @@ class MappingSystemFieldMixin[R: Record = Record, V: Any = Any](TypedSystemField
|
|
42
37
|
return []
|
43
38
|
|
44
39
|
# The following methods are added just for typing purposes.
|
45
|
-
@override
|
46
40
|
def pre_dump(self, record: R, data: dict, dumper: Dumper | None = None) -> None:
|
47
41
|
"""Dump record to the data - pre-dump phase."""
|
48
42
|
|
49
|
-
@override
|
50
43
|
def post_dump(self, record: R, data: dict, dumper: Dumper | None = None) -> None:
|
51
44
|
"""Dump record to the data - post-dump phase."""
|
52
45
|
|
53
|
-
@override
|
54
46
|
def pre_load(self, data: dict, loader: Dumper | None = None) -> None:
|
55
47
|
"""Load record from the data - pre-load phase."""
|
56
48
|
|
57
|
-
@override
|
58
49
|
def post_load(self, record: R, data: dict, loader: Dumper | None = None) -> None:
|
59
50
|
"""Load record from the data - post-load phase."""
|
@@ -10,17 +10,18 @@
|
|
10
10
|
|
11
11
|
from __future__ import annotations
|
12
12
|
|
13
|
-
from typing import TYPE_CHECKING,
|
13
|
+
from typing import TYPE_CHECKING, Self, override
|
14
14
|
|
15
15
|
from invenio_records.api import Record
|
16
16
|
|
17
|
+
from .base import TypedSystemField
|
17
18
|
from .mapping import MappingSystemFieldMixin
|
18
19
|
|
19
20
|
if TYPE_CHECKING:
|
20
21
|
from invenio_records.dumpers import Dumper
|
21
22
|
|
22
23
|
|
23
|
-
class PublicationStatusSystemField(MappingSystemFieldMixin[Record, str]):
|
24
|
+
class PublicationStatusSystemField(MappingSystemFieldMixin, TypedSystemField[Record, str]):
|
24
25
|
"""A system field to track the status of a record (either 'draft' or 'published').
|
25
26
|
|
26
27
|
The default key for this field is 'publication_status', but it can be customized.
|
@@ -45,16 +46,15 @@ class PublicationStatusSystemField(MappingSystemFieldMixin[Record, str]):
|
|
45
46
|
|
46
47
|
@override
|
47
48
|
def post_dump(self, record: Record, data: dict, dumper: Dumper | None = None) -> None:
|
48
|
-
if self.key is None:
|
49
|
-
return # pragma: no cover
|
50
49
|
if not self.attr_name:
|
51
50
|
raise ValueError( # pragma: no cover
|
52
51
|
"attr_name must be set for PublicationStatusSystemField"
|
53
52
|
)
|
54
53
|
data[self.key] = getattr(record, self.attr_name)
|
55
54
|
|
56
|
-
|
55
|
+
@override
|
56
|
+
def __get__(self, instance: Record | None, owner: type[Record]) -> Self | str: # type: ignore[override]
|
57
57
|
"""Access the attribute."""
|
58
|
-
if
|
58
|
+
if instance is None:
|
59
59
|
return self
|
60
|
-
return "draft" if getattr(
|
60
|
+
return "draft" if getattr(instance, "is_draft", False) else "published"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/records/pid_providers.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/resources/__init__.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/resources/config.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/__init__.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/config/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/__init__.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/base.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/date.py
RENAMED
File without changes
|
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/params.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/facets/utils.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/generators.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/records/links.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/records/mapping.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/results.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/schema/__init__.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/schema/i18n.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/schema/i18n_ui.py
RENAMED
File without changes
|
{oarepo_runtime-2.0.0.dev34 → oarepo_runtime-2.0.0.dev35}/oarepo_runtime/services/schema/ui.py
RENAMED
File without changes
|
File without changes
|
File without changes
|