No project description provided
Project description
OARepo model builder files
Plugin adding support for working with files based on the invenio model.
Files are represented as another ("file") record connected with the original parent one.
The plugin generates the file record and modifies the parent record to create connection with new file one.
The file record is specified under "files" attribute in the model yaml file, see example
in tests.
The plugin runs the original model builder on the files model in "files" profile, reusing a lot of the model builder code with different configuration, notably with different base classes for record, service, resource and config classes. To get an idea which code is reused, see entrypoints. For configuration changes, see model preprocessors.
Api
The files plugin provides an api for working with files. The api is by default accessible at {original model url}/{base record id}/files. The api is taken from InvenioRDM, the docs are here
Example
A simple record with associated files can be defined as this:
record:
properties:
metadata:
properties:
title:
type: fulltext
status:
type: keyword
module:
name: thesis
use:
- invenio
files:
properties:
metadata:
properties:
title:
type: fulltext
module:
name: thesis
use:
- invenio_files
settings:
schema-server: 'local://'
Using the api, first an instance of the model has to be created. Then an instance of the associated file record. The file content is then uploaded in separate step and finally the upload must be commited.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for oarepo_model_builder_files-4.0.17.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 793d561db4dff462eba4e2a78467f5283b74b87859d11df3fe6602c48841771d |
|
MD5 | c90320a0b10a44c29b432f478d4dc8e0 |
|
BLAKE2b-256 | 76e295cb3cc6b3464612ed56a7672b76548f75f9244c3b4c8dab6b8981f5cfed |
Hashes for oarepo_model_builder_files-4.0.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b91d2492fb595d73bba72aed45aea21333381c3adc1719997fedc6c45374a6d |
|
MD5 | 0261303ad38d3ebd937df5ae0d7907a4 |
|
BLAKE2b-256 | 539c937f7efc61a0494712d133d398fa170ab77f1aceeb03e1d348ad626ce19a |