Add compatibility functions for most Django database/model/app operations.

Review Request #8107 — Created April 8, 2016 and submitted

Information

Django Evolution
master
596bb68...

Reviewers

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

reviewbotreviewbot

'get_model' imported but unused

reviewbotreviewbot

'get_models' imported but unused

reviewbotreviewbot

'logging' imported but unused

reviewbotreviewbot

'get_models' imported but unused

reviewbotreviewbot

local variable 'e' is assigned to but never used

reviewbotreviewbot

'digest' imported but unused

reviewbotreviewbot

'supports_index_together' imported but unused

reviewbotreviewbot

local variable 'style' is assigned to but never used

reviewbotreviewbot

local variable 'creation' is assigned to but never used

reviewbotreviewbot

local variable 'creation' is assigned to but never used

reviewbotreviewbot

local variable 'style' is assigned to but never used

reviewbotreviewbot

local variable 'creation' is assigned to but never used

reviewbotreviewbot

local variable 'style' is assigned to but never used

reviewbotreviewbot

'get_rel_target_field' imported but unused

reviewbotreviewbot

'get_model' imported but unused

reviewbotreviewbot

'color' imported but unused

reviewbotreviewbot

'transaction' imported but unused

reviewbotreviewbot

'curry' imported but unused

reviewbotreviewbot

'clear_app_cache' imported but unused

reviewbotreviewbot

'apps' imported but unused

reviewbotreviewbot

'create_constraint_name' imported but unused

reviewbotreviewbot

'create_index_together_name' imported but unused

reviewbotreviewbot
reviewbot
  1. 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
    
    
  2. django_evolution/compat/apps.py (Diff revision 1)
     
     
    Show all issues
     'settings' imported but unused
    
  3. django_evolution/compat/apps.py (Diff revision 1)
     
     
    Show all issues
     'get_model' imported but unused
    
  4. django_evolution/compat/apps.py (Diff revision 1)
     
     
    Show all issues
     'get_models' imported but unused
    
  5. django_evolution/compat/db.py (Diff revision 1)
     
     
    Show all issues
     'logging' imported but unused
    
  6. django_evolution/compat/db.py (Diff revision 1)
     
     
    Show all issues
     'get_models' imported but unused
    
  7. django_evolution/compat/db.py (Diff revision 1)
     
     
    Show all issues
     local variable 'e' is assigned to but never used
    
  8. django_evolution/db/common.py (Diff revision 1)
     
     
    Show all issues
     'digest' imported but unused
    
  9. django_evolution/db/common.py (Diff revision 1)
     
     
    Show all issues
     'supports_index_together' imported but unused
    
  10. django_evolution/db/common.py (Diff revision 1)
     
     
    Show all issues
     local variable 'style' is assigned to but never used
    
  11. django_evolution/db/common.py (Diff revision 1)
     
     
    Show all issues
     local variable 'creation' is assigned to but never used
    
  12. django_evolution/db/common.py (Diff revision 1)
     
     
    Show all issues
     local variable 'creation' is assigned to but never used
    
  13. django_evolution/db/common.py (Diff revision 1)
     
     
    Show all issues
     local variable 'style' is assigned to but never used
    
  14. django_evolution/db/common.py (Diff revision 1)
     
     
    Show all issues
     local variable 'creation' is assigned to but never used
    
  15. django_evolution/db/common.py (Diff revision 1)
     
     
    Show all issues
     local variable 'style' is assigned to but never used
    
  16. django_evolution/db/mysql.py (Diff revision 1)
     
     
    Show all issues
     'get_rel_target_field' imported but unused
    
  17. django_evolution/db/mysql.py (Diff revision 1)
     
     
    Show all issues
     'get_model' imported but unused
    
  18. django_evolution/db/sqlite3.py (Diff revision 1)
     
     
    Show all issues
     'color' imported but unused
    
  19. django_evolution/tests/utils.py (Diff revision 1)
     
     
    Show all issues
     'transaction' imported but unused
    
  20. django_evolution/tests/utils.py (Diff revision 1)
     
     
    Show all issues
     'curry' imported but unused
    
  21. django_evolution/tests/utils.py (Diff revision 1)
     
     
    Show all issues
     'clear_app_cache' imported but unused
    
  22. django_evolution/tests/utils.py (Diff revision 1)
     
     
    Show all issues
     'apps' imported but unused
    
  23. django_evolution/tests/utils.py (Diff revision 1)
     
     
    Show all issues
     'create_constraint_name' imported but unused
    
  24. django_evolution/tests/utils.py (Diff revision 1)
     
     
    Show all issues
     'create_index_together_name' imported but unused
    
  25. 
      
reviewbot
  1. 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
    
    
  2. 
      
chipx86
reviewbot
  1. 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
    
    
  2. 
      
reviewbot
  1. 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
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (eb820d1)