diff options
Diffstat (limited to 'django/db/backends/sqlite3/introspection.py')
| -rw-r--r-- | django/db/backends/sqlite3/introspection.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/django/db/backends/sqlite3/introspection.py b/django/db/backends/sqlite3/introspection.py index eb15fdb612..0e87dcf0c6 100644 --- a/django/db/backends/sqlite3/introspection.py +++ b/django/db/backends/sqlite3/introspection.py @@ -58,9 +58,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): data_types_reverse = FlexibleFieldLookupDict() 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.""" # Skip the sqlite_sequence system table used for autoincrement key # generation. cursor.execute(""" @@ -70,7 +68,10 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): return [TableInfo(row[0], row[1][0]) 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. + """ return [ FieldInfo( info['name'], @@ -156,8 +157,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 given table. """ key_columns = [] @@ -207,9 +208,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): return indexes def get_primary_key_column(self, cursor, table_name): - """ - Get the column name of the primary key for the given table. - """ + """Return the column name of the primary key for the given table.""" # Don't use PRAGMA because that causes issues with some transactions cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s AND type = %s", [table_name, "table"]) row = cursor.fetchone() @@ -238,7 +237,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 index info |
