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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e4727dd0fbf5df1fd3c3c1c420ea4a88cf058dbf83f8c604f806885be02610b |
|
MD5 | 54c4135091c89c338d2eb81c88578bf4 |
|
BLAKE2b-256 | cbb3844adf4cf566817f2559519c92391f3dbfbf9a572f23e3d23ca5a7069579 |
Close
Hashes for wagtail_json_widget-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94fd637f695aa1a8036589891abab29b8e130e1ba67e82abf12c79c62300a9c1 |
|
MD5 | adc9ef8405ba71e42231cff92d456b98 |
|
BLAKE2b-256 | fe6009cd437502b6bc72bfc8a3e3146f5b3a2705da8016f80b4779d79f1ebf62 |