Polymorphic model builder plugin
An OARepo Model Builder plugin to generate invenio sources for polymorphic models.
Installation
pip install oarepo-model-builder-polymorphic
Usage
What is polymorphic model?
A polymorphic model is a dict that can be defined by multiple schemas. Which schema is used depends on a value of a present field (that is shared across all the schemas).
Polymorphic model can be used, for example, to express inheritance:
extension1{}:
disc: { type: keyword }
a: { type: keyword }
extension2{}:
disc: { type: keyword }
b: { type: keyword }
record:
properties:
a:
type: polymorphic
discriminator: disc
schemas:
"1": { use: "/extension1" }
"2": { use: "/extension2" }
The following are valid instances:
a:
disc: "1"
a: "blah"
---
a:
disc: "2"
b: "blah"
Invalid instance:
a:
disc: "3"
b: "blah"
---
a:
disc: "1"
a: "blah"
b: "blah"
If the "disc" field contains value "1", first extension schema will be used, if it contains value "2", second schema will be used. Any other value is not valid.
Metadata
Release files for oarepo-model-builder-polymorphic 1.0.2
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-polymorphic-1.0.2.tar.gz | 3.9 kB | Without provenance | Details for oarepo-model-builder-polymorphic-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oarepo_model_builder_polymorphic-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for oarepo_model_builder_polymorphic-1.0.2-py3-none-any.whl |
Total release size: 7.8 kB
Release files / oarepo-model-builder-polymorphic-1.0.2.tar.gz
| Download URL | oarepo-model-builder-polymorphic-1.0.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7340fa1598ad8bb56b629be133688c21e1aa8113503933e930697425bcd7442e
|
|
BLAKE2b-256 checksum How to use checksums |
cfb718d8ff159718f670afdebd91d27d345aee45e648eeb4c1c45c393e0bdec6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / oarepo_model_builder_polymorphic-1.0.2-py3-none-any.whl
| Download URL | oarepo_model_builder_polymorphic-1.0.2-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a80b5fe7710a697eb41e3c516b1ac733f042b2a7d1208ccf7304ef3490f33563
|
|
BLAKE2b-256 checksum How to use checksums |
e675847b7b35daeb71a450404419413843ef03d30ec41800e6f2c71227e14a05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for oarepo-model-builder-polymorphic 1.0.2
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.