File tree Expand file tree Collapse file tree 1 file changed +41
-1
lines changed
Expand file tree Collapse file tree 1 file changed +41
-1
lines changed Original file line number Diff line number Diff line change 1- django-json-model-widget
1+ ## django-json-model-widget
2+
3+ Django widget for storing model instances pairs in flat JsonField.
4+
5+ ### Install stable version from PyPI
6+
7+ Install from PyPI:
8+
9+ ```
10+ pip install django-flat-json-widget
11+ ```
12+
13+ ### Usage
14+
15+ Add flat_json_widget to INSTALLED_APPS:
16+
17+ ``` python
18+ INSTALLED_APPS = [
19+ # other apps...
20+ ' json_model_widget' ,
21+ ]
22+ ```
23+
24+ Then load the widget where you need it, for example, here's how to use it in the django admin site:
25+
26+ ``` python
27+ from django import forms
28+ from json_model_widget.widgets import JsonPairInputs
29+ from .models import model1, model2
30+
31+
32+ class MyForm (forms .ModelForm ):
33+ class Meta :
34+ widgets = {
35+ ' fieldname' : JsonPairInputs(model1, model2)
36+ }
37+ ```
38+
39+ ### Contributors
40+
41+ Oleg Galichkin < galij899@yandex.ru >
You can’t perform that action at this time.
0 commit comments