Skip to main content

Custom flat json field widget for model pairs

Project description

django-json-model-widget

Django widget for storing model instances pairs in flat JsonField.

Install stable version from PyPI

Install from PyPI:

pip install django-flat-json-widget

Usage

Add flat_json_widget to INSTALLED_APPS:

INSTALLED_APPS = [
    # other apps...
    'json_model_widget',
]

Then load the widget where you need it, for example, here's how to use it in the django admin site:

from django import forms
from json_model_widget.widgets import JsonPairInputs
from .models import model1, model2


class MyForm(forms.ModelForm):
    class Meta:
        widgets = {
            'fieldname': JsonPairInputs(model1, model2)
        }

Contributors

Oleg Galichkin galij899@yandex.ru

History

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

django_json_model_widget-0.0.7-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file django_json_model_widget-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: django_json_model_widget-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for django_json_model_widget-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 51874c4b2a5252ae1429cdbce140b3d9c43c44d3349f0cd505add6117da3409f
MD5 7f0b74396f8c0f691a8596d1065b6de7
BLAKE2b-256 db44088ecd42b1dd83685845ffab49904a9e157dc859d9d741f8d2a455364452

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