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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc46efd8f459401f15b3af5eb46e1d29d748e43782d7b6c28cb209ddbe271ad0 |
|
MD5 | be822b8c212c198713629b86709cfbbe |
|
BLAKE2b-256 | e694e6d3f61ef42af42f813e3b6bc6c91ce708e57d5377551d9a167762d2dda8 |
Close
Hashes for django_jsoneditor_widget-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2f5ce67e7000590a3cab3359cc1a668e30272cc91bf849ac594d5cdc510b7ec |
|
MD5 | bb950cd51c4b051ab03b0df2fcf7f6d8 |
|
BLAKE2b-256 | 5db7fc202c71d18e241eb7e306326038de7321abc43a6ee2e697361a52c956d0 |