All Projects → abogushov → Django Admin Json Editor

abogushov / Django Admin Json Editor

Licence: mit
Adds json-editor for JSONField in Django Administration

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Admin Json Editor

Django Jsoneditor
Django JSONEditor input widget to provide javascript online JSON Editor
Stars: ✭ 124 (+5.08%)
Mutual labels:  json, django
Django Import Export
Django application and library for importing and exporting data with admin integration.
Stars: ✭ 2,265 (+1819.49%)
Mutual labels:  json, django
Jsonfield
A reusable Django model field for storing ad-hoc JSON data
Stars: ✭ 1,101 (+833.05%)
Mutual labels:  json, django
Maria Quiteria
Backend para coleta e disponibilização dos dados 📜
Stars: ✭ 115 (-2.54%)
Mutual labels:  django
Fetch Plus
🐕 Fetch+ is a convenient Fetch API replacement with first-class middleware support.
Stars: ✭ 116 (-1.69%)
Mutual labels:  json
Purescript Simple Json
A simple Purescript JSON library that uses types automatically
Stars: ✭ 117 (-0.85%)
Mutual labels:  json
Config Lint
Command line tool to validate configuration files
Stars: ✭ 118 (+0%)
Mutual labels:  json
Dynaconf
Configuration Management for Python ⚙
Stars: ✭ 2,082 (+1664.41%)
Mutual labels:  django
Hearthstone Db
A JSON collection of all Hearthstone cards. Hearthstone database.
Stars: ✭ 117 (-0.85%)
Mutual labels:  json
Easy Canvas
小程序简单绘图,通过 json 方式绘制一张朋友圈分享图
Stars: ✭ 117 (-0.85%)
Mutual labels:  json
Groq
Specification for GROQ - Graph-Relational Object Queries
Stars: ✭ 117 (-0.85%)
Mutual labels:  json
Django Jinja Knockout
Django datatables and widgets, both AJAX and traditional. Display-only ModelForms. ModelForms / inline formsets with AJAX submit and validation. Works with Django templates.
Stars: ✭ 116 (-1.69%)
Mutual labels:  django
Netclient Ios
Versatile HTTP Networking in Swift
Stars: ✭ 117 (-0.85%)
Mutual labels:  json
Kafka Connect Spooldir
Kafka Connect connector for reading CSV files into Kafka.
Stars: ✭ 116 (-1.69%)
Mutual labels:  json
Drf Api Tracking
Fork of aschn/drf-tracking so that we can maintain and release newer versions
Stars: ✭ 117 (-0.85%)
Mutual labels:  django
Zoya
Truly highly composable logging utility
Stars: ✭ 116 (-1.69%)
Mutual labels:  json
Hydroshare
HydroShare is a collaborative website for better access to data and models in the hydrologic sciences.
Stars: ✭ 117 (-0.85%)
Mutual labels:  django
Captagent
100% Open-Source Packet Capture Agent for HEP
Stars: ✭ 116 (-1.69%)
Mutual labels:  json
Administrative Divisions Of China
中华人民共和国行政区划:省级(省份直辖市自治区)、 地级(城市)、 县级(区县)、 乡级(乡镇街道)、 村级(村委会居委会) ,中国省市区镇村二级三级四级五级联动地址数据。
Stars: ✭ 11,727 (+9838.14%)
Mutual labels:  json
Copybook
用爬虫爬取小说网站上所有小说,存储到数据库中,并用爬到的数据构建自己的小说网站
Stars: ✭ 117 (-0.85%)
Mutual labels:  django

Django Administration JSON Editor

Build Status

Admin Json Editor

Application adds support for editing JSONField in Django Administration via https://github.com/json-editor/json-editor.

Quick start

Install application via pip:

pip install django-admin-json-editor

Add application to the INSTALLED_APPS settings:

INSTALLED_APPS = [
    ...
    'django_admin_json_editor',
    ...
]

Define schema of json field:

DATA_SCHEMA = {
    'type': 'object',
    'title': 'Data',
    'properties': {
        'text': {
            'title': 'Some text',
            'type': 'string',
            'format': 'textarea',
        },
        'status': {
            'title': 'Status',
            'type': 'boolean',
        },
    },
}

Use JSONEditorWidget to bind editor to the form field:

class JSONModelAdminForm(forms.ModelForm):
    class Meta:
        model = JSONModel
        fields = '__all__'
        widgets = {
            'data': JSONEditorWidget(DATA_SCHEMA, collapsed=False),
        }

Dynamic schema

It is possible to build dynamic schema for widget:

def dynamic_schema(widget):
    return {
        'type': 'array',
        'title': 'tags',
        'items': {
            'type': 'string',
            'enum': [i for i in Tag.objects.values_list('name', flat=True)],
        }
    }
@admin.register(JSONModel)
class JSONModelAdmin(admin.ModelAdmin):
    def get_form(self, request, obj=None, **kwargs):
        widget = JSONEditorWidget(dynamic_schema, False)
        form = super().get_form(request, obj, widgets={'tags': widget}, **kwargs)
        return form
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].