diff --git a/news/16.feature b/news/16.feature new file mode 100644 index 0000000..c840728 --- /dev/null +++ b/news/16.feature @@ -0,0 +1 @@ +Use indent in json.dumps to make JSON readable in the widget [MrTango] \ No newline at end of file diff --git a/plone/schema/browser/jsonfield.py b/plone/schema/browser/jsonfield.py index 8990afc..9d2a8a6 100644 --- a/plone/schema/browser/jsonfield.py +++ b/plone/schema/browser/jsonfield.py @@ -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"""