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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a10776619890923f46f31ee3d75e32c73901109002310f59ead10badc2446f53 |
|
MD5 | ac1f37a1a585ab8be65f16fd59c1adee |
|
BLAKE2b-256 | 920c6d6bd717acd52e2c29eb9a3f3d3e8d7da4d8b27235f50fd68f353d6ec19d |
Close
Hashes for django_jsoneditor_widget-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40d16cec57acb82d9708494f9bed821c36eaed36a0ba7968894b4f9e929a2ecf |
|
MD5 | 6d8b0ded1b056b6db8ca22006998b59b |
|
BLAKE2b-256 | b88dd73413c7ff00e2c88f287afe49b5ac04ec1b80ad34f1945a432ac81b206c |