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
Built Distribution
Close
Hashes for wagtail_json_widget-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eb64c0f702d34fc5be1bc98f15d1b7a828d1ff6500473ee4a70dc23abfe11bf |
|
MD5 | dac298e373d936bbff14029a99baf7a5 |
|
BLAKE2b-256 | 89ae551d450543740be02d240809d9e41bb121e46b0c546e0942d78378306bc6 |
Close
Hashes for wagtail_json_widget-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb499fe48cbb71edc20e322ec151bf9382889d7cf4c331e12cf352f10d1a3bb9 |
|
MD5 | 475841c3285d301fe1aeffb4622221e1 |
|
BLAKE2b-256 | ac73538c6036524b6d3ecf2239d6081c6c2d069545aabb217981c3426566c443 |