django-admin-json-editor
django-admin-json-editor copied to clipboard
cache issue in django admin json editor
Hi,
I am using this extension(0.2.3) with Django 3.1.3 Added 1 entry via this form, when adding second entry with new data, sometimes it adds entry with first entry's data, it looks like it caching form data somewhere.
Please check the code below and help.
Thanks.
POLICY_FORM = {
"title": "Policy",
"type": "object",
"required": [
"Clicks",
"Rate"
],
"properties": {
"Clicks": {
"type": "number",
"default": 0,
"minimum": 0,
# "maximum": 9900
},
"Rate": {
"type": "number",
"default": 0,
"minimum": 0,
# "maximum": 9900
}
}
}
JSON_OPTION = {
"theme": "html",
"disable_collapse": True,
"disable_edit_json": True,
"disable_properties": True,
}
class PolicyForm(forms.ModelForm):
policy = forms.JSONField(widget = JSONEditorWidget(POLICY_FORM, collapsed=False, editor_options=JSON_OPTION))