summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-02-18 21:28:19 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-02-18 21:28:19 +0000
commit27b41fd9ded886cd44dbc0b27c6b622a743cbc28 (patch)
tree179d35de6d996ce2a3193822fff53f7837662f80
parentac97cf54af32a1bf4426e613909f0a9af3e02c94 (diff)
Added better docstring to get_indexes() for MySQL backend
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2347 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/db/backends/mysql.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/django/core/db/backends/mysql.py b/django/core/db/backends/mysql.py
index 4f80dd0d97..c4b2e870ec 100644
--- a/django/core/db/backends/mysql.py
+++ b/django/core/db/backends/mysql.py
@@ -136,7 +136,12 @@ def get_relations(cursor, table_name):
raise NotImplementedError
def get_indexes(cursor, table_name):
- "Returns a dict of indexes for given table"
+ """
+ Returns a dictionary of fieldname -> infodict for the given table,
+ where each infodict is in the format:
+ {'keyname': 'name of key',
+ 'unique': boolean representing whether it's a unique index}
+ """
cursor.execute("SHOW INDEX FROM %s" % DatabaseWrapper().quote_name(table_name))
indexes = {}
for row in cursor.fetchall():