Skip to content

Commit

Permalink
Merge pull request #16 from plone/jsonfield-widget-use-indent
Browse files Browse the repository at this point in the history
Use indent in data converter, to make json readable in widget
  • Loading branch information
jensens authored Apr 9, 2022
2 parents 9277513 + a163d48 commit 501a866
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/16.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use indent in json.dumps to make JSON readable in the widget [MrTango]
2 changes: 1 addition & 1 deletion plone/schema/browser/jsonfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def toWidgetValue(self, value):
"""See interfaces.IDataConverter"""
if value is self.field.missing_value:
return u''
return json.dumps(value)
return json.dumps(value, indent=True)

def toFieldValue(self, value):
"""See interfaces.IDataConverter"""
Expand Down

0 comments on commit 501a866

Please sign in to comment.