Commits

Andrew Godwin committed e59d246

Fix weird unused variables (#479)

  • Participants
  • Parent commits ec28c77

Comments (0)

Files changed (6)

File south/creator/changes.py

         for key in self.old_defs:
             if key not in deleted_models:
                 
-                still_there = set()
-                
                 old_fields, old_meta, old_m2ms = self.split_model_def(self.old_orm[key], self.old_defs[key])
                 new_fields, new_meta, new_m2ms = self.split_model_def(self.current_model_from_key(key), self.new_defs[key])
                 

File south/db/generic.py

             return ''
 
         connection = self._get_connection()
-        if db_tablespace and self._get_connection().features.supports_tablespaces:
-            tablespace_sql = ' ' + self._get_connection().ops.tablespace_sql(db_tablespace)
+        if db_tablespace and connection.features.supports_tablespaces:
+            tablespace_sql = ' ' + connection.ops.tablespace_sql(db_tablespace)
         else:
             tablespace_sql = ''
 

File south/db/sql_server/pyodbc.py

 
     def _find_indexes_for_column(self, table_name, name):
         "Find the indexes that apply to a column, needed when deleting"
-        q_table_name, q_name = (self.quote_name(table_name), self.quote_name(name))
 
         sql = """
         SELECT si.name, si.id, sik.colid, sc.name
 
     def _find_constraints_for_column(self, table_name, name):
         "Find the constraints that apply to a column, needed when deleting"
-        q_table_name, q_name = (self.quote_name(table_name), self.quote_name(name))
 
         sql = """
         SELECT  

File south/management/commands/migrate.py

     args = "[appname] [migrationname|zero] [--all] [--list] [--skip] [--merge] [--no-initial-data] [--fake] [--db-dry-run] [--database=dbalias]"
 
     def handle(self, app=None, target=None, skip=False, merge=False, backwards=False, fake=False, db_dry_run=False, show_list=False, database=DEFAULT_DB_ALIAS, delete_ghosts=False, ignore_ghosts=False, **options):
-
-        # Work out what the resolve mode is
-        resolve_mode = merge and "merge" or (skip and "skip" or None)
         
         # NOTE: THIS IS DUPLICATED FROM django.core.management.commands.syncdb
         # This code imports any module named 'management' in INSTALLED_APPS.
             for app in apps:
                 result = migration.migrate_app(
                     app,
-                    #resolve_mode = resolve_mode,
                     target_name = target,
                     fake = fake,
                     db_dry_run = db_dry_run,

File south/migration/__init__.py

         if last and migration not in done:
             yield last, migration
 
-def problems(pending, done):
-    last = None
-    if not pending:
-        raise StopIteration()
-    for migration in pending:
-        if migration in done:
-            last = migration
-            continue
-        if last and migration not in done:
-            yield last, migration
-
 def forwards_problems(pending, done, verbosity):
     """
     Takes the list of linearised pending migrations, and the set of done ones,

File south/tests/logic.py

     def test_guess_migration(self):
         # Can't use vanilla import, modules beginning with numbers aren't in grammar
         M1 = __import__("fakeapp.migrations.0001_spam", {}, {}, ['Migration']).Migration
-        M2 = __import__("fakeapp.migrations.0002_eggs", {}, {}, ['Migration']).Migration
         migration = Migrations('fakeapp')
         self.assertEqual(M1, migration.guess_migration("0001_spam").migration().Migration)
         self.assertEqual(M1, migration.guess_migration("0001_spa").migration().Migration)