Update management commands to work on newer versions of Django.

Review Request #8742 — Created Feb. 13, 2017 and submitted

Information

Django Evolution
master
b2396f0...

Reviewers

Modern versions of Django require some changes for management commands.
For instance, ArgumentParser is used instead of OptionParser, and
options can't be defined directly on the class.

Django Evolution needs to support versions of Django prior to these
changes. In order to do that, we now have a new base class for
management commands that allows subclasses to adhere to the new
requirements while also providing backwards-compatibility for older
versions of Django. All common types of options are supported.

This brings us a step closer to supporting Django 1.10.

Unit tests pass.

Tested the management commands on Django 1.6 through 1.10.

Tested Djblets against these changes on Django 1.6 through 1.10.

Description From Last Updated

I don't see where this method is used

daviddavid

Docstring?

daviddavid

Docstring?

daviddavid

'make_option' imported but unused

reviewbotreviewbot

It might be nice to extract everything within this block into its own method--things are getting pretty deeply nested.

daviddavid

The cursor needs to be closed.

daviddavid
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        django_evolution/management/commands/wipe-evolution.py
        django_evolution/management/commands/evolve.py
        django_evolution/management/commands/list-evolutions.py
        django_evolution/compat/commands.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        django_evolution/management/commands/wipe-evolution.py
        django_evolution/management/commands/evolve.py
        django_evolution/management/commands/list-evolutions.py
        django_evolution/compat/commands.py
    
    
  2. Show all issues
     'make_option' imported but unused
    
  3. 
      
david
  1. 
      
  2. django_evolution/compat/commands.py (Diff revision 1)
     
     
    Show all issues

    I don't see where this method is used

    1. This is used internally by Django. I'll add docs.

  3. django_evolution/compat/commands.py (Diff revision 1)
     
     
    Show all issues

    Docstring?

  4. django_evolution/compat/commands.py (Diff revision 1)
     
     
    Show all issues

    Docstring?

  5. Show all issues

    It might be nice to extract everything within this block into its own method--things are getting pretty deeply nested.

    1. I don't want to do any surgery for this command in this change.

  6. Show all issues

    The cursor needs to be closed.

    1. Not making any changes beyond porting for this change. There's larger work I'd like to do anyway to gut most of this command.

    2. At least add a FIXME or TODO comment?

  7. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        django_evolution/management/commands/wipe-evolution.py
        django_evolution/management/commands/evolve.py
        django_evolution/management/commands/list-evolutions.py
        django_evolution/compat/commands.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        django_evolution/management/commands/wipe-evolution.py
        django_evolution/management/commands/evolve.py
        django_evolution/management/commands/list-evolutions.py
        django_evolution/compat/commands.py
    
    
  2. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        django_evolution/management/commands/wipe-evolution.py
        django_evolution/management/commands/evolve.py
        django_evolution/management/commands/list-evolutions.py
        django_evolution/compat/commands.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        django_evolution/management/commands/wipe-evolution.py
        django_evolution/management/commands/evolve.py
        django_evolution/management/commands/list-evolutions.py
        django_evolution/compat/commands.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (597cbeb)