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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7acbedb12ddf132379c3a986bc6c80a750b61fba33dae7d61c4d24a24815e35 |
|
MD5 | ddb9b35ff4b01697528d8d3ead72f4b8 |
|
BLAKE2b-256 | 6cc4f3243cb407948defa96939526ef8e803eeaca14465397d26f8fcb4174e55 |
Close
Hashes for django_jsoneditor_widget-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a727dab73b2efc1d66cbbe26c5fd3d58c7fa385487c6b298477868bb9ad1cd3 |
|
MD5 | 03e36fac44d7e50bdcc6f36c136d1750 |
|
BLAKE2b-256 | 278f3c987b0e497a1277d460e80f650b2665b8b26e0551bfab0e761a368e8aea |