mirror of https://github.com/django/django.git
Fixed #646 -- inspectdb no longer fails on database tables with hyphen in the name. Thanks for reporting, jack at xiph.org
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1688 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
551897b134
commit
676830165a
|
@ -126,7 +126,7 @@ def get_table_list(cursor):
|
|||
|
||||
def get_table_description(cursor, table_name):
|
||||
"Returns a description of the table, with the DB-API cursor.description interface."
|
||||
cursor.execute("SELECT * FROM %s LIMIT 1" % table_name)
|
||||
cursor.execute("SELECT * FROM %s LIMIT 1" % DatabaseWrapper.quote_name(table_name))
|
||||
return cursor.description
|
||||
|
||||
def get_relations(cursor, table_name):
|
||||
|
|
|
@ -102,7 +102,7 @@ def get_table_list(cursor):
|
|||
|
||||
def get_table_description(cursor, table_name):
|
||||
"Returns a description of the table, with the DB-API cursor.description interface."
|
||||
cursor.execute("SELECT * FROM %s LIMIT 1" % table_name)
|
||||
cursor.execute("SELECT * FROM %s LIMIT 1" % DatabaseWrapper().quote_name(table_name))
|
||||
return cursor.description
|
||||
|
||||
def get_relations(cursor, table_name):
|
||||
|
|
|
@ -128,7 +128,7 @@ def get_table_list(cursor):
|
|||
return [row[0] for row in cursor.fetchall()]
|
||||
|
||||
def get_table_description(cursor, table_name):
|
||||
cursor.execute("PRAGMA table_info(%s)" % table_name)
|
||||
cursor.execute("PRAGMA table_info(%s)" % DatabaseWrapper.quote_name(table_name))
|
||||
return [(row[1], row[2], None, None) for row in cursor.fetchall()]
|
||||
|
||||
def get_relations(cursor, table_name):
|
||||
|
|
Loading…
Reference in New Issue