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
django-jsoneditor-widget-1.0.5.tar.gz
(173.1 kB
view hashes)
Built Distribution
Close
Hashes for django-jsoneditor-widget-1.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bdea44470f4bde10ec276f2b4b2907f32c2569fc369bcd37ed195429943d745 |
|
MD5 | e6054c1e37c58a86159131394057bc4b |
|
BLAKE2b-256 | 2345a0167fa3e2b88580b0c43ba9a046f48d9903f6aed216046ebf9f02a3f747 |
Close
Hashes for django_jsoneditor_widget-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f970acd697a11ab2911ebd732d10a9fe30be1c58e7fbd97c79d733d099a82a9 |
|
MD5 | 0b20bddafea9e96f4299f4080f21637b |
|
BLAKE2b-256 | f7c517d03633c9ba577191f3a6b2d36a227c14478432360f630601e8d1ced842 |