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
File details
Details for the file oarepo_model_builder_files-4.0.18.tar.gz
.
File metadata
- Download URL: oarepo_model_builder_files-4.0.18.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92c9b70e6febd7796b24431c12c27c6c8a11cfdb46805885145dbd776bb5f9d3 |
|
MD5 | eb241687a196686656d34fa39a6e6262 |
|
BLAKE2b-256 | 16e9bb1ce668777ab113a4d48e42be164c1e28edb43d2f3794695af8741b60cb |
File details
Details for the file oarepo_model_builder_files-4.0.18-py3-none-any.whl
.
File metadata
- Download URL: oarepo_model_builder_files-4.0.18-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aed040678647de23f288bc577237c229eb392f6e8ee28f99cc55a4325a14a045 |
|
MD5 | c08fd0ffae68080d8736c68ea55c8654 |
|
BLAKE2b-256 | bb4b3bac2d54d435e5e24b61a7ea27ee02747b2306f923d330311c6145049830 |