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.panels 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, blank=True)
content_panels = Page.content_panels + [
FieldPanel('myjson'),
]
base_form_class = MyPageForm
As a StreamField block:
from wagtail import blocks
from wagtail_json_widget.blocks import JSONBlock
class MyBlock(blocks.StructBlock):
my_json_block = JSONBlock(default='{}')
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wagtail_json_widget-0.0.9.tar.gz
(255.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wagtail_json_widget-0.0.9.tar.gz.
File metadata
- Download URL: wagtail_json_widget-0.0.9.tar.gz
- Upload date:
- Size: 255.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d80976cc7d9d0754b06a0779ff10ad76b89b38570f597b2231cb1ea61a9359c
|
|
| MD5 |
1380606cd3d41b0264057f352701c27b
|
|
| BLAKE2b-256 |
f103bde22e3ef383d485195e2fa2d82983c8a945da0a34a352a39cd01c4c9645
|
File details
Details for the file wagtail_json_widget-0.0.9-py3-none-any.whl.
File metadata
- Download URL: wagtail_json_widget-0.0.9-py3-none-any.whl
- Upload date:
- Size: 257.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bbcb97fcc0a63fac2ba2091bc33fb1383dcdda163130447319ce4b7da493e05
|
|
| MD5 |
d49e9134cf71cd18ade7bf55239e66ea
|
|
| BLAKE2b-256 |
3400f0cd6a6c6eae99f86f9d60113bc574d76921244e59969a739d1234a05e78
|