A simple Django app to add JSON widget into Django Administration.
Project description
# Django Administration JSON Editor
Application adds support for editing JSONField in Django Administration via https://github.com/jdorn/json-editor.
## Quick start
Install application via pip:
```bash
pip install django-admin-json-editor
```
Add application to the INSTALLED_APPS settings:
```python
INSTALLED_APPS = [
...
'django_admin_json_editor',
...
]
```
Define schema of json field:
```python
DATA_SCHEMA = {
'type': 'object',
'title': 'Data',
'properties': {
'text': {
'title': 'Some text',
'type': 'string',
'format': 'textarea',
},
'status': {
'title': 'Status',
'type': 'boolean',
},
},
}
```
Use JSONEditorWidget to bind editor to the form field:
```python
class JSONModelAdminForm(forms.ModelForm):
class Meta:
model = JSONModel
fields = '__all__'
widgets = {
'data': JSONEditorWidget(DATA_SCHEMA, collapsed=False),
}
```
Application adds support for editing JSONField in Django Administration via https://github.com/jdorn/json-editor.
## Quick start
Install application via pip:
```bash
pip install django-admin-json-editor
```
Add application to the INSTALLED_APPS settings:
```python
INSTALLED_APPS = [
...
'django_admin_json_editor',
...
]
```
Define schema of json field:
```python
DATA_SCHEMA = {
'type': 'object',
'title': 'Data',
'properties': {
'text': {
'title': 'Some text',
'type': 'string',
'format': 'textarea',
},
'status': {
'title': 'Status',
'type': 'boolean',
},
},
}
```
Use JSONEditorWidget to bind editor to the form field:
```python
class JSONModelAdminForm(forms.ModelForm):
class Meta:
model = JSONModel
fields = '__all__'
widgets = {
'data': JSONEditorWidget(DATA_SCHEMA, collapsed=False),
}
```
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
django-admin-json-editor-0.1.3.tar.gz
(940.7 kB
view hashes)
Close
Hashes for django-admin-json-editor-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bfd3d2701e5f5408e4747dfaaf7d0e34b00348c53096f4af186a29a8ee64d83 |
|
MD5 | d93965baa290e8378a412abc451639f8 |
|
BLAKE2b-256 | f0178ab666b2dee8a9e63b37aa3d40cf4baf4ef2a490a3537eb18ede5b438504 |