Skip to content

Commit 22783f5

Browse files
committed
improved README.MD
1 parent ecc06bd commit 22783f5

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

README.MD

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,41 @@
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>

0 commit comments

Comments
 (0)