From 1788b0c96fe2afdd8b14ab1ca06f27ce4f31ba8d Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 15 Sep 2007 16:18:44 +0000 Subject: [PATCH] Variable renaming. I didn't feel comfortable with the tricky re-aliasing in the line table_list=table_list(). git-svn-id: http://code.djangoproject.com/svn/django/trunk@6290 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management/commands/syncdb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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.