Add compatibility functions for most Django database/model/app operations.
Review Request #8107 — Created April 8, 2016 and submitted
As a precursor to adding support for newer versions of Django, this change adds a new set of compatibility functions and imports that wrap either deprecated or internal methods in Django, all of which have moved or been replaced in newer versions. Most of this is code movement, but there's a lot of it. The django_evolution.compat module has a number of new sub-modules for database operations, SQL generation, model/app manipulation and lookup, and moved imports. The various callers have been updated to call into these instead of hard-coding access to the wrapped functions. Along with this, I've improved the documentation for most of the functions that have been updated.
Unit tests pass for SQLite, MySQL, and Postgres.
Description | From | Last Updated |
---|---|---|
'settings' imported but unused |
reviewbot | |
'get_model' imported but unused |
reviewbot | |
'get_models' imported but unused |
reviewbot | |
'logging' imported but unused |
reviewbot | |
'get_models' imported but unused |
reviewbot | |
local variable 'e' is assigned to but never used |
reviewbot | |
'digest' imported but unused |
reviewbot | |
'supports_index_together' imported but unused |
reviewbot | |
local variable 'style' is assigned to but never used |
reviewbot | |
local variable 'creation' is assigned to but never used |
reviewbot | |
local variable 'creation' is assigned to but never used |
reviewbot | |
local variable 'style' is assigned to but never used |
reviewbot | |
local variable 'creation' is assigned to but never used |
reviewbot | |
local variable 'style' is assigned to but never used |
reviewbot | |
'get_rel_target_field' imported but unused |
reviewbot | |
'get_model' imported but unused |
reviewbot | |
'color' imported but unused |
reviewbot | |
'transaction' imported but unused |
reviewbot | |
'curry' imported but unused |
reviewbot | |
'clear_app_cache' imported but unused |
reviewbot | |
'apps' imported but unused |
reviewbot | |
'create_constraint_name' imported but unused |
reviewbot | |
'create_index_together_name' imported but unused |
reviewbot |
-
Tool: PEP8 Style Checker Processed Files: django_evolution/mutations.py django_evolution/db/common.py django_evolution/compat/apps.py django_evolution/tests/db/postgresql.py django_evolution/compat/db.py django_evolution/diff.py django_evolution/utils.py django_evolution/tests/signature.py django_evolution/tests/utils.py django_evolution/compat/datastructures.py django_evolution/db/mysql.py django_evolution/management/commands/list-evolutions.py django_evolution/db/sqlite3.py django_evolution/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/tests/test_generics.py django_evolution/compat/models.py django_evolution/signature.py django_evolution/management/commands/evolve.py
- Change Summary:
-
Fixed unused imports and variable declarations.
- Commit:
-
85ffc7ea117a36b4c280f6af662f219ab5d9f15e596bb6869fae3992b407d279cec0a18bbf967a58
-
Tool: Pyflakes Processed Files: django_evolution/mutations.py django_evolution/db/common.py django_evolution/compat/apps.py django_evolution/tests/db/postgresql.py django_evolution/compat/db.py django_evolution/diff.py django_evolution/utils.py django_evolution/tests/signature.py django_evolution/tests/utils.py django_evolution/compat/datastructures.py django_evolution/db/mysql.py django_evolution/management/commands/list-evolutions.py django_evolution/db/sqlite3.py django_evolution/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/tests/test_generics.py django_evolution/compat/models.py django_evolution/signature.py django_evolution/management/commands/evolve.py
-
Tool: PEP8 Style Checker Processed Files: django_evolution/mutations.py django_evolution/db/common.py django_evolution/compat/apps.py django_evolution/tests/db/postgresql.py django_evolution/compat/db.py django_evolution/diff.py django_evolution/utils.py django_evolution/tests/signature.py django_evolution/tests/utils.py django_evolution/compat/datastructures.py django_evolution/db/mysql.py django_evolution/management/commands/list-evolutions.py django_evolution/db/sqlite3.py django_evolution/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/tests/test_generics.py django_evolution/compat/models.py django_evolution/signature.py django_evolution/management/commands/evolve.py