'Called when the application for this Migrations is set.
Imports the migrations module object, and throws a paddy if it can\'t.'

def set_application(self, application, force_creation=False, verbose_creation=True):

    self._application = application
    if ((not hasattr(application, 'migrations')) and (not hasattr(application, 'south_migrations'))):
        try:
            module = importlib.import_module(self.migrations_module())
            self._migrations = application.migrations = module
        except ImportError:
            if force_creation:
                self.create_migrations_directory(verbose_creation)
                module = importlib.import_module(self.migrations_module())
                self._migrations = application.migrations = module
            else:
                raise exceptions.NoMigrations(application)
    if hasattr(application, 'south_migrations'):
        self._load_migrations_module(application.south_migrations)
    else:
        self._load_migrations_module(application.migrations)
