FormField that properly render HStoreField Data in django Admin based on djangoauts package
and updated fork of django-admin-hstore-widget
- Python 3.9 and Up ( well technically any python version from 3.6 should work )
- Django 3.2 and Up
Using pip:
pip install django-hstore-widget
# settings.py
INSTALLED_APPS = [
...,
'django_hstore_widget',
...
]
# yourmodel/admin.py
from django.contrib import admin
from django import forms
from django_hstore_widget.forms import HStoreFormField
from models import Yourmodel
class MyModelAdminForm(forms.ModelForm):
my_hstore_field = HStoreFormField()
class Meta:
model = Yourmodel
@admin.register(Yourmodel)
class YourmodelAdmin(admin.ModelAdmin):
form = MyModelAdminForm