Skip to content

Commit

Permalink
Use indent in data converter, to make json readable in widget
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTango committed Apr 8, 2022
1 parent 9277513 commit a163d48
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 a163d48

Please sign in to comment.