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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 005577ba08749c8b6f2fc834bbce9123fa40cadd98d614559edbe5dfc3f46f42 |
|
MD5 | f233e6fdcbc4ba22b929fde13e97a13d |
|
BLAKE2b-256 | 515d78f78a1f0ce6480d7a521a6519c062ab6baf0c23f29047af5af07b0a358c |
Close
Hashes for wagtail_json_widget-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8498df302bf0e66c1cd81821361afc9fdca6d9ecf6c86e07d3dc6c4f010474ec |
|
MD5 | 1f608d76142163d8199e59ac91db7e85 |
|
BLAKE2b-256 | 5f78d94ed5f3f7d80683e05ad96c2b21c6943b29c62dcdfd81ca2c56fe63dd47 |