collective.z3cform.jsonwidget
z3c.form widget to manage a json field.
Features
Customizable schema
Usage
You need to set the widget to needed fields into your form instance:
from collective.z3cform.jsonwidget.browser.widget import JSONFieldWidget
from zope.interface import Interface
from zope import schema
class IMyJsonSchema(Interface):
first = schema.TextLine(
title='first field',
required=True,
)
second = schema.List(
title="second field",
required=False,
value_type=schema.TextLine(),
)
class IFormSchema(Interface):
my_json_field = schema.SourceText(
title="The field with some stored json values"
)
class MyForm(Form):
...
schema = IFormSchema
fields = field.Fields(IFormSchema)
fields["my_json_field"].widgetFactory = JSONFieldWidget
def updateWidgets(self):
"""
"""
super(MyForm, self).updateWidgets()
self.widgets["my_json_field"].schema = IMyJsonSchema
With this configuration, we are setting JSONFieldWidget widget to my_json_field field and setting the fields schema defined in IMyJsonSchema interface.
In the field are stored a list of json objects where each object has a set of fields defined in the schema.
For example for the given configuration, we are going to store into the field something like:
[
{
"first": "a string",
"second": [1,2,3,4]
},
{
"first": "another string",
"second": ["a", "b", "c"]
},
]
Translations
This product has been translated into
Italian
Installation
Install collective.z3cform.jsonwidget by adding it to your buildout:
[buildout]
...
eggs =
collective.z3cform.jsonwidget
and then running bin/buildout
Contribute
Credits
Developed with the support of Regione Emilia Romagna;
Regione Emilia Romagna supports the PloneGov initiative.
2.0.2 (2026-10-22)
Added redturtle.reactbundle as dependency. [daniele]
Fix uninstall profile: remove also plone.bundles/z3cform-jsonwidget bundle registered since 2.0.0. [cekk]
2.0.1 (2026-07-07)
Fixed wrong logger import in upgrade. [daniele]
2.0.0 (2026-03-26)
Plone 6 compatibility. Use 1.x tags for Plone < 6. [cekk] [cekk]
1.1.2 (2023-04-26)
Fix release. [cekk]
1.1.1 (2023-04-21)
Handle integer fields. [cekk]
1.1.0 (2022-07-18)
Force vocabularies batch size to 1000 to get all of possible values. [cekk]
1.0.0 (2021-12-20)
Improve widget usability. [cekk]
0.2.4 (2021-12-13)
Fix defaulValue in select fields. Now we can also reset the values. [cekk]
0.2.3 (2021-08-18)
Fix homepage breadcrumb. [cekk]
0.2.2 (2021-08-17)
Fix breadcrumbs and pagination in ReferenceField. [cekk]
0.2.1 (2021-05-18)
Add alt text on buttons
Add locales for a11y hints [nzambello]
0.2.0 (2021-05-17)
Add link and path to referenced items [nzambello]
Fix TextLine field. [cekk]
0.1.0 (2021-02-09)
Initial release. [cekk]
Metadata
Release files for collective.z3cform.jsonwidget 2.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 |
|---|---|---|---|---|
| collective_z3cform_jsonwidget-2.0.2.tar.gz | 759.6 kB | Without provenance | Details for collective_z3cform_jsonwidget-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| collective_z3cform_jsonwidget-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for collective_z3cform_jsonwidget-2.0.2-py3-none-any.whl |
Total release size: 1.5 MB
Release files / collective_z3cform_jsonwidget-2.0.2.tar.gz
| Download URL | collective_z3cform_jsonwidget-2.0.2.tar.gz |
|---|---|
| Size | 759.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60bccd0ca4c259dfb1296a0b29af8c7740643d01d51c0647df9070f4f3bf0410
|
|
BLAKE2b-256 checksum How to use checksums |
1a271e7259f353a8a69b7872bffc874aecc8b906aac3116df96a1ec7e250297f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Release files / collective_z3cform_jsonwidget-2.0.2-py3-none-any.whl
| Download URL | collective_z3cform_jsonwidget-2.0.2-py3-none-any.whl |
|---|---|
| Size | 705.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a7f863f96cb941d6b821ca891c6c4259ba4b50c782afcd137bd0cdd5a202d22
|
|
BLAKE2b-256 checksum How to use checksums |
ac92a3716dfb0a13bd412fc2f247bc498da9a9f390e4f03d1445e697f6d2f4e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Security for collective.z3cform.jsonwidget 2.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.