JSONEditor for Wagtail CMS
Project description
Wagtail JSON Widget
JSON editing for Wagtail Admin.
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2049254b9fff4e9e8cab03cc68af636ffbfd27940e40429b8864e06cea2ee5d |
|
MD5 | 728ce90b6ce05a436c6b0afacc58385d |
|
BLAKE2b-256 | 9fecf16cd50e012a9d5e13b033ef6d40ddefc5b3c1cad2a235add2d4d2d0d88f |
Close
Hashes for wagtail_json_widget-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a2f0f134874a6314efeb83f82c8fef113a8e9c95a5b3b93fe1f039a512b16c3 |
|
MD5 | 45aee21f1b19edf30220db6c5ddcc6e8 |
|
BLAKE2b-256 | 6bc24c520391edaefb6274ebb92c8bbfe095bd3bb9a794ac809d82c3dde35d6b |