collective.z3cform.jsonwidget


Namecollective.z3cform.jsonwidget JSON
Version 1.1.2 PyPI version JSON
download
home_pagehttps://github.com/collective/collective.z3cform.jsonwidget
SummaryCustom widget to manage complex json data stored into a text field
upload_time2023-04-26 20:41:41
maintainer
docs_urlNone
authorAndrea Cecchi
requires_python>=3.7
licenseGPL version 2
keywords python plone
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            .. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
   This text does not appear on pypi or github. It is a comment.

=============================
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
----------

- Issue Tracker: https://github.com/collective/collective.z3cform.jsonwidget/issues
- Source Code: https://github.com/collective/collective.z3cform.jsonwidget


Credits
-------

Developed with the support of `Regione Emilia Romagna`__;

Regione Emilia Romagna supports the `PloneGov initiative`__.

__ http://www.regione.emilia-romagna.it/
__ http://www.plonegov.it/

Authors
-------

This product was developed by RedTurtle Technology team.

.. image:: http://www.redturtle.net/redturtle_banner.png
   :alt: RedTurtle Technology Site
   :target: http://www.redturtle.net/


Contributors
============

- Andrea Cecchi, andrea.cecchi85@gmail.com


Changelog
=========


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]
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/collective/collective.z3cform.jsonwidget",
    "name": "collective.z3cform.jsonwidget",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "Python Plone",
    "author": "Andrea Cecchi",
    "author_email": "andrea.cecchi85@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1b/2d/96f8af711065fea67772a6edc82ce5343009c31ec27d428e2cb16b306f62/collective.z3cform.jsonwidget-1.1.2.tar.gz",
    "platform": null,
    "description": ".. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.\n   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html\n   This text does not appear on pypi or github. It is a comment.\n\n=============================\ncollective.z3cform.jsonwidget\n=============================\n\nz3c.form widget to manage a json field.\n\nFeatures\n--------\n\n- Customizable schema\n\nUsage\n-----\n\nYou need to set the widget to needed fields into your form instance::\n\n    from collective.z3cform.jsonwidget.browser.widget import JSONFieldWidget\n    from zope.interface import Interface\n    from zope import schema\n\n\n    class IMyJsonSchema(Interface):\n        first = schema.TextLine(\n            title='first field',\n            required=True,\n        )\n        second = schema.List(\n            title=\"second field\",\n            required=False,\n            value_type=schema.TextLine(),\n        )\n\n    class IFormSchema(Interface):\n        my_json_field = schema.SourceText(\n            title=\"The field with some stored json values\"\n        )\n\n    class MyForm(Form):\n\n        ...\n        schema = IFormSchema\n        fields = field.Fields(IFormSchema)\n        fields[\"my_json_field\"].widgetFactory = JSONFieldWidget\n\n        def updateWidgets(self):\n            \"\"\"\n            \"\"\"\n            super(MyForm, self).updateWidgets()\n            self.widgets[\"my_json_field\"].schema = IMyJsonSchema\n\n\nWith this configuration, we are setting **JSONFieldWidget** widget to **my_json_field** field and\nsetting the fields schema defined in **IMyJsonSchema** interface.\n\nIn the field are stored a list of json objects where each object has a set of fields defined in the schema.\n\nFor example for the given configuration, we are going to store into the field something like::\n\n    [\n        {\n            \"first\": \"a string\",\n            \"second\": [1,2,3,4]\n        },\n        {\n            \"first\": \"another string\",\n            \"second\": [\"a\", \"b\", \"c\"]\n        },\n    ]\n\n\nTranslations\n------------\n\nThis product has been translated into\n\n- Italian\n\n\nInstallation\n------------\n\nInstall collective.z3cform.jsonwidget by adding it to your buildout::\n\n    [buildout]\n\n    ...\n\n    eggs =\n        collective.z3cform.jsonwidget\n\n\nand then running ``bin/buildout``\n\n\nContribute\n----------\n\n- Issue Tracker: https://github.com/collective/collective.z3cform.jsonwidget/issues\n- Source Code: https://github.com/collective/collective.z3cform.jsonwidget\n\n\nCredits\n-------\n\nDeveloped with the support of `Regione Emilia Romagna`__;\n\nRegione Emilia Romagna supports the `PloneGov initiative`__.\n\n__ http://www.regione.emilia-romagna.it/\n__ http://www.plonegov.it/\n\nAuthors\n-------\n\nThis product was developed by RedTurtle Technology team.\n\n.. image:: http://www.redturtle.net/redturtle_banner.png\n   :alt: RedTurtle Technology Site\n   :target: http://www.redturtle.net/\n\n\nContributors\n============\n\n- Andrea Cecchi, andrea.cecchi85@gmail.com\n\n\nChangelog\n=========\n\n\n1.1.2 (2023-04-26)\n------------------\n\n- Fix release.\n  [cekk]\n\n\n1.1.1 (2023-04-21)\n------------------\n\n- Handle integer fields.\n  [cekk]\n\n1.1.0 (2022-07-18)\n------------------\n\n- Force vocabularies batch size to 1000 to get all of possible values.\n  [cekk]\n\n\n1.0.0 (2021-12-20)\n------------------\n\n- Improve widget usability.\n  [cekk]\n\n\n0.2.4 (2021-12-13)\n------------------\n\n- Fix defaulValue in select fields. Now we can also reset the values.\n  [cekk]\n\n0.2.3 (2021-08-18)\n------------------\n\n- Fix homepage breadcrumb.\n  [cekk]\n\n\n0.2.2 (2021-08-17)\n------------------\n\n- Fix breadcrumbs and pagination in ReferenceField.\n  [cekk]\n\n\n0.2.1 (2021-05-18)\n------------------\n\n- Add alt text on buttons\n- Add locales for a11y hints\n  [nzambello]\n\n\n0.2.0 (2021-05-17)\n------------------\n\n- Add link and path to referenced items\n  [nzambello]\n- Fix TextLine field.\n  [cekk]\n\n0.1.0 (2021-02-09)\n------------------\n\n- Initial release.\n  [cekk]",
    "bugtrack_url": null,
    "license": "GPL version 2",
    "summary": "Custom widget to manage complex json data stored into a text field",
    "version": "1.1.2",
    "split_keywords": [
        "python",
        "plone"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b2d96f8af711065fea67772a6edc82ce5343009c31ec27d428e2cb16b306f62",
                "md5": "a306da60670af44b5da196af370decfd",
                "sha256": "63eb6d8e923307e6b89723ff7874c0068dd791fb7f2490c528a780701f27aff0"
            },
            "downloads": -1,
            "filename": "collective.z3cform.jsonwidget-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a306da60670af44b5da196af370decfd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 310211,
            "upload_time": "2023-04-26T20:41:41",
            "upload_time_iso_8601": "2023-04-26T20:41:41.650717Z",
            "url": "https://files.pythonhosted.org/packages/1b/2d/96f8af711065fea67772a6edc82ce5343009c31ec27d428e2cb16b306f62/collective.z3cform.jsonwidget-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-26 20:41:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "collective",
    "github_project": "collective.z3cform.jsonwidget",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": false,
    "requirements": [],
    "lcname": "collective.z3cform.jsonwidget"
}
        
Elapsed time: 0.06203s