dj-jkabachcha-field
Django J(son) field is a package to create Json WYSIWYG model field. This is mainly to have a cool editable view in Admin. The package ships with a model field which has its widget as a Json WYSIYG. It also provides a widget which can be independently used to override existing model fields which are using TextArea. Overall there can be two ways
* As a ModelField
* As a Widget
Installation
-
Install it through pip
pip install dj-jkabachcha
-
Download and install manually
git clone https://github.com/paytm/dj-j-ka-bachcha-field.git cd dj-j-ka-bachcha-field python setup.py install
Use
-
Add
jkabachcha
in yourINSTALLED_APPS
likeINSTALLED_APPS = ( ... 'jkabachcha', )
-
Collect static files by running
python manage.py collectstatic
-
Now import it in your models like
from jkabachcha.db.fields import JsonField
-
Create fields like
json_text = JsonField()
-
This can be used as a widget to override TextArea in Admin panel like
# import widget from jkabachcha.forms.widgets import JsonTextWidget # in ModelAdmin class, like formfield_overrides = { models.TextField : {'widget': JsonTextWidget}, }
Screenshots
Credits
This package uses jsoneditor and jquery as its dependency.