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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 752c78df5e3c23cc776353ecc70db715b8839a9c76b99e9a6c323d5fb5bb1732 |
|
MD5 | 6b95724253492a2e5690cdc7e1076d58 |
|
BLAKE2b-256 | e1afb412153b722447854b9c642241e01dce4620b8d75c5a48f0f9ec4cfc6197 |
Close
Hashes for django_jsoneditor_widget-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 111695594c7958357a4cb9372182616a7585ab5c7a18d6bbaf0588cda6caa804 |
|
MD5 | 07f4ccfe740782a8ff45d19b5451c9e5 |
|
BLAKE2b-256 | 2cd3fdc7dc8031b58919319357f0f51e5e1a4d4115604091ac1a5c18fd5ff670 |