diff options
author | Anton Samarchyan <anton.samarchyan@savoirfairelinux.com> | 2017-01-24 18:04:12 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-02-28 09:17:27 -0500 |
commit | 60e52a047e55bc4cd5a93a8bd4d07baed27e9a22 (patch) | |
tree | 010a363968b1ed41adf2e64c98d572d7148a2a5e /django/db/backends/mysql/introspection.py | |
parent | d6e26e5b7c8063c2cc5aa045edea6555bf358fc2 (diff) | |
download | django-60e52a047e55bc4cd5a93a8bd4d07baed27e9a22.tar.gz |
Refs #27656 -- Updated django.db docstring verbs according to PEP 257.
Diffstat (limited to 'django/db/backends/mysql/introspection.py')
-rw-r--r-- | django/db/backends/mysql/introspection.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/django/db/backends/mysql/introspection.py b/django/db/backends/mysql/introspection.py index 455e88962f..42a47d2dad 100644 --- a/django/db/backends/mysql/introspection.py +++ b/django/db/backends/mysql/introspection.py @@ -50,16 +50,15 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): return field_type def get_table_list(self, cursor): - """ - Returns a list of table and view names in the current database. - """ + """Return a list of table and view names in the current database.""" cursor.execute("SHOW FULL TABLES") return [TableInfo(row[0], {'BASE TABLE': 't', 'VIEW': 'v'}.get(row[1])) for row in cursor.fetchall()] def get_table_description(self, cursor, table_name): """ - Returns a description of the table, with the DB-API cursor.description interface." + Return a description of the table with the DB-API cursor.description + interface." """ # information_schema database gives more accurate results for some figures: # - varchar length returned by cursor.description is an internal length, @@ -99,7 +98,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): def get_relations(self, cursor, table_name): """ - Returns a dictionary of {field_name: (field_name_other_table, other_table)} + Return a dictionary of {field_name: (field_name_other_table, other_table)} representing all relationships to the given table. """ constraints = self.get_key_columns(cursor, table_name) @@ -110,8 +109,8 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): def get_key_columns(self, cursor, table_name): """ - Returns a list of (column_name, referenced_table_name, referenced_column_name) for all - key columns in given table. + Return a list of (column_name, referenced_table_name, referenced_column_name) + for all key columns in the given table. """ key_columns = [] cursor.execute(""" @@ -153,7 +152,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): def get_storage_engine(self, cursor, table_name): """ - Retrieves the storage engine for a given table. Returns the default + Retrieve the storage engine for a given table. Return the default storage engine if the table doesn't exist. """ cursor.execute( @@ -167,7 +166,8 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): def get_constraints(self, cursor, table_name): """ - Retrieves any constraints or keys (unique, pk, fk, check, index) across one or more columns. + Retrieve any constraints or keys (unique, pk, fk, check, index) across + one or more columns. """ constraints = {} # Get the actual constraint names and columns |