Fixed #460 -- Added 'django-admin.py inspectdb' support for SQLite. Thanks, Swaroop

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1484 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-11-29 02:05:32 +00:00
parent 539e5af17c
commit de7a336486
8 changed files with 32 additions and 8 deletions

View file

@ -100,6 +100,11 @@ def get_table_list(cursor):
AND pg_catalog.pg_table_is_visible(c.oid)""")
return [row[0] for row in cursor.fetchall()]
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)
return cursor.description
def get_relations(cursor, table_name):
"""
Returns a dictionary of {field_index: (field_index_other_table, other_table)}