Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 27b41fd9ded886cd44dbc0b27c6b622a743cbc28 1 parent ac97cf5
@adrianholovaty adrianholovaty authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 django/core/db/backends/mysql.py
View
7 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():
Please sign in to comment.
Something went wrong with that request. Please try again.