def get_migration_callback():
    """ Reusing original migration callback """
    migrate = MigrateCommand()
    parser = migrate.create_parser(argv[0], argv[1])
    options = parser.parse_args(argv[2:])
    migrate.verbosity = options.verbosity
    return migrate.migration_progress_callback
Beispiel #2
0
def migrate(params=None):
    command = MigrateCommand()
    parser = command.create_parser('manage.py', 'migrate')
    options = parser.parse_args(params or [])
    cmd_options = vars(options)
    return command.execute(**cmd_options)