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.2.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.2-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-jsoneditor-widget-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 bc46efd8f459401f15b3af5eb46e1d29d748e43782d7b6c28cb209ddbe271ad0
MD5 be822b8c212c198713629b86709cfbbe
BLAKE2b-256 e694e6d3f61ef42af42f813e3b6bc6c91ce708e57d5377551d9a167762d2dda8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_jsoneditor_widget-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f2f5ce67e7000590a3cab3359cc1a668e30272cc91bf849ac594d5cdc510b7ec
MD5 bb950cd51c4b051ab03b0df2fcf7f6d8
BLAKE2b-256 5db7fc202c71d18e241eb7e306326038de7321abc43a6ee2e697361a52c956d0

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