diff --git a/django/core/management/commands/syncdb.py b/django/core/management/commands/syncdb.py index c1f360a985..202ad004f0 100644 --- a/django/core/management/commands/syncdb.py +++ b/django/core/management/commands/syncdb.py @@ -40,14 +40,14 @@ class Command(NoArgsCommand): # Get a list of all existing database tables, # so we know what needs to be added. - table_list = table_list() + tables = table_list() if connection.features.uses_case_insensitive_names: table_name_converter = str.upper else: table_name_converter = lambda x: x # Get a list of already installed *models* so that references work right. - seen_models = installed_models(table_list) + seen_models = installed_models(tables) created_models = set() pending_references = {} @@ -59,7 +59,7 @@ class Command(NoArgsCommand): # Create the model's database table, if it doesn't already exist. if verbosity >= 2: print "Processing %s.%s model" % (app_name, model._meta.object_name) - if table_name_converter(model._meta.db_table) in table_list: + if table_name_converter(model._meta.db_table) in tables: continue sql, references = sql_model_create(model, self.style, seen_models) seen_models.add(model) @@ -71,7 +71,7 @@ class Command(NoArgsCommand): print "Creating table %s" % model._meta.db_table for statement in sql: cursor.execute(statement) - table_list.append(table_name_converter(model._meta.db_table)) + tables.append(table_name_converter(model._meta.db_table)) # Create the m2m tables. This must be done after all tables have been created # to ensure that all referred tables will exist.