Example #1
0
 def migration(self):
     "Tries to load the actual migration module"
     full_name = self.full_name()
     try:
         migration = sys.modules[full_name]
     except KeyError:
         try:
             migration = __import__(full_name, '', '', ['Migration'])
         except ImportError, e:
             raise exceptions.UnknownMigration(self, sys.exc_info())
         except Exception, e:
             raise exceptions.BrokenMigration(self, sys.exc_info())
Example #2
0
 def migration(self):
     "Tries to load the actual migration module"
     full_name = self.full_name()
     try:
         migration = sys.modules[full_name]
     except KeyError:
         try:
             migration = __import__(full_name, {}, {}, ['Migration'])
         except ImportError as e:
             raise exceptions.UnknownMigration(self, sys.exc_info())
         except Exception as e:
             raise exceptions.BrokenMigration(self, sys.exc_info())
     # Override some imports
     migration._ = lambda x: x  # Fake i18n
     migration.datetime = datetime_utils
     return migration