abogushov / django-admin-json-editor

Adds json-editor for JSONField in Django Administration
MIT License
173 stars 61 forks source link

Problem with widget rendering passed schema #13

Closed chubz closed 6 years ago

chubz commented 6 years ago

Hi, I had a problem with rendering the widget with any dict schema passed. My project uses py2.7 and django 1.11.10

It seems that when pure dict is passed to the context it doesn't turn into a json string that schema attribute for the JS part likes to render. it turns into a string that contains {u'title': 'sometitle'}

I've added json.dumps to assure json string is sent to the context and now widget renders the schema properly.

abogushov commented 6 years ago

@chubz thanks.