mirror of
https://github.com/django/django.git
synced 2025-10-06 00:30:37 +00:00
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:
parent
539e5af17c
commit
de7a336486
8 changed files with 32 additions and 8 deletions
|
@ -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)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue