oarepo-runtime 1.4.20__py3-none-any.whl → 1.4.21__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 +1,11 @@
1
+ from typing import Type
1
2
 
3
+ from invenio_records_resources.records import Record
4
+
5
+
6
+ def select_record_for_update(record_cls: Type[Record], persistent_identifier):
7
+ """Select a record for update."""
8
+ resolved_record = record_cls.pid.resolve(persistent_identifier)
9
+ model_id = resolved_record.model.id
10
+ obj = record_cls.model_cls.query.filter_by(id=model_id).with_for_update().one()
11
+ return record_cls(obj.data, model=obj)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oarepo-runtime
3
- Version: 1.4.20
3
+ Version: 1.4.21
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -62,7 +62,7 @@ oarepo_runtime/i18n/dumper.py,sha256=PbNFCLsiH4XV3E1v8xga_fzlcEImHy8OXn_UKh_8VBU
62
62
  oarepo_runtime/i18n/schema.py,sha256=wJLyE4Ew4mqEGoMpM6JOsyyqGCV_R4YgWQUm45AHVPU,1184
63
63
  oarepo_runtime/i18n/ui_schema.py,sha256=9r2j9zCG60yVEhcEFaz8TvmNGMAkzaOJFfKri3rtVck,1854
64
64
  oarepo_runtime/i18n/validation.py,sha256=fyMTi2Rw-KiHv7c7HN61zGxRVa9sAjAEEkAL5wUyKNo,236
65
- oarepo_runtime/records/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
65
+ oarepo_runtime/records/__init__.py,sha256=Bxm2XNtB9j6iOAKGSVsjXTKIZS-iXKPzakCqyNkEix8,432
66
66
  oarepo_runtime/records/dumpers/__init__.py,sha256=OmzNhLdMNKibmCksnj9eTX9xPBG30dziiK3j3bAAp3k,233
67
67
  oarepo_runtime/records/dumpers/edtf_interval.py,sha256=YCShZAoqBQYaxVilEVotS-jXZsxxoXO67yu2urhkaMA,1198
68
68
  oarepo_runtime/records/systemfields/__init__.py,sha256=JpDSVry8TWvUNGlR7AXd_D9NDLiVN2xg9qxjNit96Sw,257
@@ -97,9 +97,9 @@ oarepo_runtime/ui/marshmallow.py,sha256=ov96Ooo9n9lFPcUGm8aWzTR5d7LbgCQss1iOAy3z
97
97
  oarepo_runtime/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
98
  oarepo_runtime/utils/path.py,sha256=V1NVyk3m12_YLbj7QHYvUpE1wScO78bYsX1LOLeXDkI,3108
99
99
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
- oarepo_runtime-1.4.20.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
101
- oarepo_runtime-1.4.20.dist-info/METADATA,sha256=LiUNJZcQ1nsC_8URC-FGyrcNKY-W5o6X1DLWcmoIsrM,4288
102
- oarepo_runtime-1.4.20.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
103
- oarepo_runtime-1.4.20.dist-info/entry_points.txt,sha256=DaNLz4CZpasjXP0PPfPEhVd8Q72_8YBf34st6PHeQn0,238
104
- oarepo_runtime-1.4.20.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
105
- oarepo_runtime-1.4.20.dist-info/RECORD,,
100
+ oarepo_runtime-1.4.21.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
101
+ oarepo_runtime-1.4.21.dist-info/METADATA,sha256=a85YOB_gmWwPZjwmPvJqkbDDPB4eAyglmnn9ruVMdSA,4288
102
+ oarepo_runtime-1.4.21.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
103
+ oarepo_runtime-1.4.21.dist-info/entry_points.txt,sha256=DaNLz4CZpasjXP0PPfPEhVd8Q72_8YBf34st6PHeQn0,238
104
+ oarepo_runtime-1.4.21.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
105
+ oarepo_runtime-1.4.21.dist-info/RECORD,,