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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0626e0f5c94635fb4f6d10ae63e227101abfb43098ed8ed295b2cb05059b2341 |
|
MD5 | 467b6030d20aadcd94417e243f33493f |
|
BLAKE2b-256 | e2f009a52d8a9953fb7b4cd755ea0f4ce14dc713f245c89ed1ca7183c71a2576 |
Close
Hashes for django_jsoneditor_widget-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0da62b577ed53c35b1dc44a819a0b0361027906284cb64a4308e8f4c29e1788 |
|
MD5 | 8181aa78e05b72a0e925d42f43811468 |
|
BLAKE2b-256 | 23f1df51e7708ca7962262103f23aca6a05ce31a15fa69ea00c83aaeac3b13dd |