Replace third-party JSONField with Django's built-in JSONField
Checklist
- [x] I have read the OpenWISP Contributing Guidelines.
- [x] I have manually tested the changes proposed in this pull request.
- [x] I have written new test cases for new code and/or updated existing tests for changes to existing code.
- [ ] I have updated the documentation.
Reference to Existing Issue
Closes #1061.
Description of Changes
Replaced all remaining usages of the third-party jsonfield.JSONField with Django’s built-in JSONField.
The update includes:
-
Updating imports across all affected models to
django.db.models.JSONField -
Removing
load_kwargsanddump_kwargsparameters that are no longer supported -
Updating admin preview handling to correctly parse JSON values sent as strings
-
Including minimal schema-only
AlterFieldmigrations in both theconfigandconnectionapps -
Adjusting tests where necessary to work with Django’s JSONField, which returns Python objects instead of formatted JSON strings
These changes remove reliance on the unmaintained jsonfield package and align the project with Django's native JSON handling while keeping full compatibility with existing data.
Screenshot
N/A
Hi @DragnEmperor , All CI blocking issues have now been resolved. This update corrects import ordering, applies full isort/black/flake8 formatting, fixes the failing test_device_put_api by flattening the payload and using native dicts/lists required by Django’s JSONField, updates JSONField-related tests in the connection module, reformats migration files to meet the 88-character limit, and aligns model/migration definitions (blank=True consistency). These changes ensure QA compliance and compatibility with Django’s native JSONField. All required fixes have been applied, Could you please trigger a CI rebuild when convenient?