-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: django-mongodb-backend-5.2.1
-
Component/s: django
-
🔵 Done
-
Python Drivers
-
Not Needed
-
None
-
None
-
None
-
None
-
None
-
None
Context
There is a lot of relative imports in project, that should be replaced with absolute ones.
For example in ./django_mongodb_backend/fields/array.py
from ..forms import SimpleArrayField from ..query_utils import process_lhs, process_rhs from ..utils import prefix_validation_error from ..validators import ArrayMaxLengthValidator, LengthValidator
imports should be done like:
from django_mongodb_backend.forms import SimpleArrayField from django_mongodb_backend.query_utils import process_lhs, process_rhs from django_mongodb_backend.utils import prefix_validation_error from django_mongodb_backend.validators import ArrayMaxLengthValidator, LengthValidator
This changes will increase the readability of the code, and its logical coherence.
Definition of done
All relative imports in django_mongodb_backend directory should be converted into absolute ones.
Pitfalls
Broken imports