magic-removal: Removed introspection table_exists() functions -- they weren't being used, and you can just use get_table_list()

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2465 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-03-02 04:50:43 +00:00
parent 910986dde2
commit a93fbfd616
5 changed files with 1 additions and 35 deletions

View File

@ -10,7 +10,4 @@ def get_relations(cursor, table_name):
def get_indexes(cursor, table_name):
raise NotImplementedError
def table_exists(cursor, table_name):
raise NotImplementedError
DATA_TYPES_REVERSE = {}

View File

@ -4,6 +4,5 @@ get_table_list = complain
get_table_description = complain
get_relations = complain
get_indexes = complain
table_exists = complain
DATA_TYPES_REVERSE = {}

View File

@ -28,16 +28,6 @@ def get_indexes(cursor, table_name):
indexes[row[4]] = {'primary_key': (row[2] == 'PRIMARY'), 'unique': not bool(row[1])}
return indexes
def table_exists(cursor, table_name):
"""Returns True if the given table exists."""
try:
cursor.execute("SELECT 1 FROM %s LIMIT 1" % quote_name(table_name))
except:
transaction.rollback_unless_managed()
return False
else:
return True
DATA_TYPES_REVERSE = {
FIELD_TYPE.BLOB: 'TextField',
FIELD_TYPE.CHAR: 'CharField',

View File

@ -68,16 +68,6 @@ def get_indexes(cursor, table_name):
indexes[col_name] = {'primary_key': row[2], 'unique': row[1]}
return indexes
def table_exists(cursor, table_name):
"""Returns True if the given table exists."""
try:
cursor.execute("SELECT 1 FROM %s LIMIT 1" % quote_name(table_name))
except:
transaction.rollback_unless_managed()
return False
else:
return True
# Maps type codes to Django Field types.
DATA_TYPES_REVERSE = {
16: 'BooleanField',

View File

@ -15,16 +15,6 @@ def get_relations(cursor, table_name):
def get_indexes(cursor, table_name):
raise NotImplementedError
def table_exists(cursor, table_name):
"""Returns True if the given table exists."""
try:
cursor.execute("SELECT 1 FROM %s LIMIT 1" % quote_name(table_name))
except:
transaction.rollback_unless_managed()
return False
else:
return True
# Maps SQL types to Django Field types. Some of the SQL types have multiple
# entries here because SQLite allows for anything and doesn't normalize the
# field type; it uses whatever was given.