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.3.tar.gz (1.8 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.3-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-jsoneditor-widget-1.0.3.tar.gz
  • Upload date:
  • Size: 1.8 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.3.tar.gz
Algorithm Hash digest
SHA256 0626e0f5c94635fb4f6d10ae63e227101abfb43098ed8ed295b2cb05059b2341
MD5 467b6030d20aadcd94417e243f33493f
BLAKE2b-256 e2f009a52d8a9953fb7b4cd755ea0f4ce14dc713f245c89ed1ca7183c71a2576

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_jsoneditor_widget-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a0da62b577ed53c35b1dc44a819a0b0361027906284cb64a4308e8f4c29e1788
MD5 8181aa78e05b72a0e925d42f43811468
BLAKE2b-256 23f1df51e7708ca7962262103f23aca6a05ce31a15fa69ea00c83aaeac3b13dd

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