Skip to content

[models] Replace third-party JSONField with Django built-in JSONField#259

Open
Eeshu-Yadav wants to merge 2 commits intoopenwisp:masterfrom
Eeshu-Yadav:issues/253-replace-thirdparty-jsonfield
Open

[models] Replace third-party JSONField with Django built-in JSONField#259
Eeshu-Yadav wants to merge 2 commits intoopenwisp:masterfrom
Eeshu-Yadav:issues/253-replace-thirdparty-jsonfield

Conversation

@Eeshu-Yadav
Copy link

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • 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 #253.

Description of Changes

Models Updated:

  • openwisp_network_topology/base/node.py: Updated JSONField usage in addresses, properties, and user_properties fields
  • openwisp_network_topology/base/link.py: Updated JSONField usage in properties and user_properties fields

Eeshu-Yadav and others added 2 commits August 12, 2025 14:48
…penwisp#253

Migrated from the unmaintained third-party jsonfield package to Django's
native JSONField which has been available since Django 3.1.

Changes made:
- Updated imports in base/node.py and base/link.py to use Django's JSONField
- Removed third-party specific parameters (load_kwargs, dump_kwargs)
- Changed default=[] to default=list for better compatibility
- Removed jsonfield dependency from requirements.txt
- Created data-preserving migrations for both main and test apps
- Added comprehensive migration documentation

Benefits:
- No longer dependent on unmaintained third-party package
- Better long-term security and maintenance
- Native Django ORM integration
- Performance improvements with database-native JSON support

All existing JSON data is preserved and functionality remains identical.

Fixes openwisp#253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[change:network-topology] Replace thirdparty JSONField with Django built in JSONField

2 participants