JSONEditor for Wagtail CMS
Project description
Wagtail JSON Widget
JSON editing for Wagtail Admin with JSON Editor
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | df8539af93a9c2c4a3e119bc1d7f1e5315dcf10bd0448fb4b69cf80038cf451b |
|
MD5 | 2fd799e01f8341bdd5e600179d3da439 |
|
BLAKE2b-256 | 7bfdc84ba90ea614443984576457c7b5da1fa836dba1eea8c8b7487db87c9c15 |
Close
Hashes for wagtail_json_widget-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dd3057f0ebbd218f3f5e2bdbd91963066fae25d54748c5b2cff934d4c596878 |
|
MD5 | eb852373be2b33ef1b28710f7d895711 |
|
BLAKE2b-256 | a4a0f3d39ee022ab8e4d37b64af1546c6be55d216f05147b14c42cabcfb1b146 |