django-json-widget
django-json-widget copied to clipboard
Widget doesn't work with boolean values
- django-json-widget version:
- Django version: 5.0.2
- Python version: 3.10
- Operating System: Ubuntu
Description
The widget doesn't display data if the JSONField contains a boolean value. It throws a javascript exception:
Uncaught ReferenceError: True is not defined
at change/:982:186
at change/:984:7
Loaded data in HTML:
var json = {'label': 'Metered consumption - house', 'category': 'consumption', 'convertToNegative': True};
Hi,
The value "true" in JSON need be lower case "true" and not "True".
Thanks.
Hi,
The value "true" in JSON need be lower case "true" and not "True".
Thanks.
Yeah, I've tried to save it with true but widget convert it back to "Python" syntax True.