This package makes jQuery Option Tree available as a deform form library widget. jQuery Option Tree converts a JSON option tree into dynamically created <select> elements allowing you to choose one nested option from the tree.
Currently only one feature for a very specific use case is implemented, hierarchical browsing from a data structure like this:
key value --- ----- 1 Option 1 11 Suboption 1.1 111 Subsubption 1.1.1 112 Subsubption 1.1.2 12 Suboption 1.2 2 Option 2 21 Suboption 2.1 22 Suboption 2.2 3 Option 3
This is suitable for hierarchical selections from standards like ISCO08 or NACE Rev. 2
The implementation currently requires the data to be exposed by a REST service with 2 endpoints that are reachable via a common base URL (the json_url option of the widget):
json_url has to return the top level key/value pairs
json_url with the GET parameter ìd has to return the child elements for the given id.
json_url + ‘/<id>/lineage’ has to return the lineage of IDs from root to leaf for the given <id>.
Examples:
json_url = '/api/classifications/nace_rev2'
# GET call to '/api/classifications/nace_rev2'
# has to return a structure like this:
{
A: "LAND- UND FORSTWIRTSCHAFT, FISCHEREI",
B: "BERGBAU UND GEWINNUNG VON STEINEN UND ERDEN",
C: "VERARBEITENDES GEWERBE/HERSTELLUNG VON WAREN"
}
# GET call to '/api/classifications/nace_rev2?id=A'
# has to return a structure like this:
{
A01: "Landwirtschaft, Jagd und damit verbundene Tätigkeiten",
A02: "Forstwirtschaft und Holzeinschlag",
A03: "Fischerei und Aquakultur"
}
# GET call to '/api/classifications/nace_rev2/Q8690/lineage'
# has to return a structure like this:
["Q", "Q86", "Q869", "Q8690"]
See the included demo application for details.
Contributions
Contributions are welcome, especially if you want to add support for more generic data structures and/or configurable options for the plugin.
Changes
0.2.1
Fix JS error when initializing empty field.
0.2
Change Javascript to allow better configuration
Move the fanstatic need() call to the serialize method.
0.1
Initial release.
Metadata
Release files for deform_widget_jquery_option_tree 0.2.1
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 |
|---|---|---|---|---|
| deform_widget_jquery_option_tree-0.2.1.tar.gz | 89.6 kB | Without provenance | Details for deform_widget_jquery_option_tree-0.2.1.tar.gz |
Release files / deform_widget_jquery_option_tree-0.2.1.tar.gz
| Download URL | deform_widget_jquery_option_tree-0.2.1.tar.gz |
|---|---|
| Size | 89.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a6ffca1de617c9ff2a31846c6296e266961362451f355be50404184ed816ffa
|
|
BLAKE2b-256 checksum How to use checksums |
1508f0ac4b69af6f32c7d337909e98bc96ac61724a815f9a82a2d359c756f567
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for deform_widget_jquery_option_tree 0.2.1
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.