You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

create_migration.py 720B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python
  2. """
  3. Convenience script to create migrations
  4. """
  5. from optparse import OptionParser
  6. from tests.config import configure
  7. configure()
  8. def create_migration(app_label, **kwargs):
  9. from south.management.commands.schemamigration import Command
  10. com = Command()
  11. com.handle(app=app_label, **kwargs)
  12. if __name__ == '__main__':
  13. parser = OptionParser()
  14. parser.add_option('-i', '--initial', dest='initial',
  15. action='store_true', default=False)
  16. parser.add_option('-a', '--auto', dest='auto',
  17. action='store_true', default=False)
  18. (options, args) = parser.parse_args()
  19. create_migration(args[0], initial=options.initial, auto=options.auto)