Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache issue in django admin json editor #38

Open
mavajikitl opened this issue Sep 13, 2021 · 0 comments
Open

cache issue in django admin json editor #38

mavajikitl opened this issue Sep 13, 2021 · 0 comments

Comments

@mavajikitl
Copy link

mavajikitl commented Sep 13, 2021

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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant