Skip to content

cache issue in django admin json editor #38

@mavajikitl

Description

@mavajikitl

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions