def list_migrations(apps, database=DEFAULT_DB_ALIAS, **options):
 from south.models import MigrationHistory
 applied_migrations = MigrationHistory.objects.filter(app_name__in=[app.app_label() for app in apps])
 if (database != DEFAULT_DB_ALIAS):
  applied_migrations = applied_migrations.using(database)
 applied_migrations_lookup = dict(((('%s.%s' % (mi.app_name, mi.migration)), mi) for mi in applied_migrations))
 print()
 for app in apps:
  print((' ' + app.app_label()))
  for migration in app:
   full_name = ((migration.app_label() + '.') + migration.name())
   if (full_name in applied_migrations_lookup):
    applied_migration = applied_migrations_lookup[full_name]
    print(format_migration_list_item(migration.name(), applied=applied_migration.applied, **options))
   else:
    print(format_migration_list_item(migration.name(), applied=False, **options))
  print()

def list_migrations ( apps , database = DEFAULT_DB_ALIAS , ** options ) : from south . models import MigrationHistory applied_migrations = MigrationHistory . objects . filter ( app_name__in = [ app . app_label ( ) for app in apps ] ) if ( database != DEFAULT_DB_ALIAS ) : applied_migrations = applied_migrations . using ( database ) applied_migrations_lookup = dict ( ( ( ( '%s.%s' % ( mi . app_name , mi . migration ) ) , mi ) for mi in applied_migrations ) ) print ( ) for app in apps : print ( ( ' ' + app . app_label ( ) ) ) for migration in app : full_name = ( ( migration . app_label ( ) + '.' ) + migration . name ( ) ) if ( full_name in applied_migrations_lookup ) : applied_migration = applied_migrations_lookup [ full_name ] print ( format_migration_list_item ( migration . name ( ) , applied = applied_migration . applied , ** options ) ) else : print ( format_migration_list_item ( migration . name ( ) , applied = False , ** options ) ) print ( )
prints a list of all available migrations .