JSONEditor for Wagtail CMS
Project description
Wagtail JSON Widget
JSON editing for Wagtail Admin with josdejong / jsoneditor. Provides widgets for Page and StreamField.
Installation
Install from PyPI:
pip install wagtail-json-widget
Then add the following to your project's INSTALLED_APPS
.
'wagtail_json_widget',
Usage
As a field:
from django.db import models
from django import forms
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.admin.forms import WagtailAdminPageForm
from wagtail.core.models import Page
from .blocks import MyStreamBlock
from wagtail_json_widget.widgets import JSONEditorWidget
class MyPageForm(WagtailAdminPageForm):
myjson = forms.JSONField(widget=JSONEditorWidget, required=False)
class MyPage(Page):
myjson = models.JSONField(null=True)
content_panels = Page.content_panels + [
FieldPanel('myjson'),
]
base_form_class = MyPageForm
As a StreamField block:
from wagtail.core import blocks
from wagtail_json_widget.blocks import JsonBlock
class MyBlock(blocks.StructBlock):
my_json_block = JsonBlock()
...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wagtail_json_widget-0.0.6.tar.gz
(254.4 kB
view hashes)
Built Distribution
Close
Hashes for wagtail_json_widget-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc0bab8f7774845856cbd781f539bb735c462ebea0028813c298818237b73883 |
|
MD5 | fe849b1b9cd92bceca4e04308f795955 |
|
BLAKE2b-256 | 565771fe77c27409ab9929aee4734d184c6efd4348528f2a43a4bd16d5f25136 |
Close
Hashes for wagtail_json_widget-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 084a4d5b7549e48ba61d2e6e171689e5e56ac05a3cbaed2a7326d3c546b3ecad |
|
MD5 | 3542b118dd6d855e1f09b6735670b8e0 |
|
BLAKE2b-256 | fe18506f3b292e5da6a291a67cc1fbb51ee30a09b3deb8fc16336504fe5189fd |