OARepo model builder requests
Plugin for oarepo-model-builder to allow specifying requests
tied to the base model, based on invenio requests.
Requests are requests for an action concerning an instance of the model (called topic in this context), for example to publish the topic.
The requests are specified as request types (each type has its own class). Each request type has pre-specified actions from the invenio framework. The plugin allows to customize the accept action.
By default, along with changing the request status, the generated accept action fetches the associated record. It's up to the developer to decide what to do with it further.
Requests can be added to the model through "requests" section in the yaml file of the model. There can be any number of them. Options in the yaml:
-
moduleModule in which the request is stored. The type and action modules are derived from it but can override the default. -
typeSettings for the type class of the request. Used if the user wants to use a custom request type class.moduleclassbasesimportsgenerateTrue by defualt, False is typically used when user provides custom Type class.parent-actionsRequest type class specifies actions that can be performed by the request. By default the class imports its parent's possible actions, but this behavior can be customized if the parent class has different structure for some reason.
-
actionsA list of customized actions by this type of request. Only the accept action is supported for now.-
module -
classAnalogous to type class for the action. By default it's invenio_requests.customizations.AcceptAction. -
bases -
imports -
generateAnalogous to type class for the action. -
basesAnalogous to type class bases for the action.
-
It also allows specifying the topic record resolver used. The resolver is tied to the topic class therefore it's generated on record level instead of the request. Configurable options:
moduleclassbasesimportsgeneratecustom-proxy-classThe resolver can use different proxy record resolution class. This is needed for resolving drafts because they don't have registered PIDs.
Examples
For example, the requests plugin can be used for approving a thesis. The accept action can be used for approval. A simple yaml entry at the root level can be used:
requests:
approve-thesis: {}
This generates all the basic files. The generated action does the predefined changes in the default invenio base class, specifically changes the request status, and provides a template for modifying the associated thesis record (topic). The template fetches the record and saves changes on it. What to do with the thesis during is up to the developer. They have to replace this code with their own implementation.
## todo - do something with the record
# topic["status"] = "accepted"
##
Alternatively, they can define the accept action class on their own and import it instead of generating.
requests:
approve-thesis:
class: thesis.requests.ApproveAction
generate: False
Metadata
Release files for oarepo-model-builder-requests 4.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oarepo_model_builder_requests-4.1.10.tar.gz | 15.2 kB | Without provenance | Details for oarepo_model_builder_requests-4.1.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oarepo_model_builder_requests-4.1.10-py3-none-any.whl | Python 3 | none | any | Details for oarepo_model_builder_requests-4.1.10-py3-none-any.whl |
Total release size: 42.9 kB
Release files / oarepo_model_builder_requests-4.1.10.tar.gz
| Download URL | oarepo_model_builder_requests-4.1.10.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85eda2f9218b383eb4391d47fb1a04adeafa5d10db2d5b3014d2ceaf9b4a4199
|
|
BLAKE2b-256 checksum How to use checksums |
5de9f5a04705222d35a66393db8d0432799d38e05e06c574d15258f451d4f9af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / oarepo_model_builder_requests-4.1.10-py3-none-any.whl
| Download URL | oarepo_model_builder_requests-4.1.10-py3-none-any.whl |
|---|---|
| Size | 27.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11c47e3e106bb4f8f31712bfa81e255a0ff94e3f72bdce82d692c12d6b698305
|
|
BLAKE2b-256 checksum How to use checksums |
d89268f07e37111feb7e0cab8f0e50146c0d081d2c59636aa878ee572d0256d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for oarepo-model-builder-requests 4.1.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.