Django form widget form JSONField
Project description
django-jsoneditor-widget
Django form widget form JSONField
Demo
It look like this.
Install
- Install:
pip install django-jsoneditor-widget
- Settings:
INSTALLED_APPS = [ # some apps .... 'jsoneditor', # other apps ... ]
Create model
from django.db import models
from django.contrib.postgres.fields import JSONField
class Book(models.Model):
name = models.CharField(max_length=150)
information = JSONField()
def __str__(self):
return self.name
Admin site settings
-
Use ModelAdmin
from django.contrib import admin from jsoneditor.admin import JSONFieldModelAdmin from .models import Book admin.site.register(Product, JSONFieldModelAdmin)
-
Use mixin
from django.contrib import admin @admin.register(Book) class BookModelAdmin(JSONFieldAdminMixin, admin.ModelAdmin): pass
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
Built Distribution
Close
Hashes for django-jsoneditor-widget-1.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | de955ce65706bd825a20ec757272d6e0f2bf9f6e87791e5addaaa8ee169ba230 |
|
MD5 | 4b97b453800985bc5bc47e8610942100 |
|
BLAKE2b-256 | f312b89295ba25ce81734d789282c0070b61317b56260c81a7e91a4b5f1405a0 |
Close
Hashes for django_jsoneditor_widget-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d450732acd3293f6d62fb97acd2e74a0cd290a7b88dfc53ce9932f3fe8ec7c5 |
|
MD5 | 34d586d3900d7045975ef40008c98ab6 |
|
BLAKE2b-256 | 3aa7f167c8dc9715a9a0c0f68103a50dd0c437b757323fc06c5cc59b4dae848c |