From 27b41fd9ded886cd44dbc0b27c6b622a743cbc28 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 18 Feb 2006 21:28:19 +0000 Subject: [PATCH] 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 --- django/core/db/backends/mysql.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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():