Skip to main content

Django form widget form JSONField

Project description

django-jsoneditor-widget

Django form widget form JSONField

Demo

It look like this.

demo image

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-jsoneditor-widget-1.0.7.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_jsoneditor_widget-1.0.7-py3-none-any.whl (180.4 kB view details)

Uploaded Python 3

File details

Details for the file django-jsoneditor-widget-1.0.7.tar.gz.

File metadata

  • Download URL: django-jsoneditor-widget-1.0.7.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for django-jsoneditor-widget-1.0.7.tar.gz
Algorithm Hash digest
SHA256 3c1eb9b6f73f26d1bce5aca73885d45bf6a90b481ea566dc374733a8997e37c4
MD5 d056aeac2339ac555b3e5cf6a7341e89
BLAKE2b-256 4b4d0fe47f0ac4c7559d6e905aec9ab0067c58612a36df841febc019f24300d3

See more details on using hashes here.

File details

Details for the file django_jsoneditor_widget-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: django_jsoneditor_widget-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 180.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for django_jsoneditor_widget-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 900dcf5396b0db35c6ebddca7086ccf5b84b2a2ffe5bf18dc1c91abb65430b0e
MD5 f9744a8ebb25ca37a3b31a3b46abd85c
BLAKE2b-256 82bc4166ce7bd5d4a31ccc3677ecf3c02dc6d91256b6a4403ff396fde1137abd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page