summaryrefslogtreecommitdiff
path: root/django/db/backends
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/backends')
-rw-r--r--django/db/backends/mysql/base.py6
-rw-r--r--django/db/backends/mysql/introspection.py6
-rw-r--r--django/db/backends/oracle/introspection.py6
-rw-r--r--django/db/backends/postgresql/introspection.py6
-rw-r--r--django/db/backends/sqlite3/introspection.py6
5 files changed, 10 insertions, 20 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
index eb0e361d8d..07f4305068 100644
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -405,16 +405,14 @@ class DatabaseWrapper(BaseDatabaseWrapper):
# Select some server variables and test if the time zone
# definitions are installed. CONVERT_TZ returns NULL if 'UTC'
# timezone isn't loaded into the mysql.time_zone table.
- cursor.execute(
- """
+ cursor.execute("""
SELECT VERSION(),
@@sql_mode,
@@default_storage_engine,
@@sql_auto_is_null,
@@lower_case_table_names,
CONVERT_TZ('2001-01-01 01:00:00', 'UTC', 'UTC') IS NOT NULL
- """
- )
+ """)
row = cursor.fetchone()
return {
"version": row[0],
diff --git a/django/db/backends/mysql/introspection.py b/django/db/backends/mysql/introspection.py
index ea1d0aa187..e5092d9df1 100644
--- a/django/db/backends/mysql/introspection.py
+++ b/django/db/backends/mysql/introspection.py
@@ -73,16 +73,14 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_table_list(self, cursor):
"""Return a list of table and view names in the current database."""
- cursor.execute(
- """
+ cursor.execute("""
SELECT
table_name,
table_type,
table_comment
FROM information_schema.tables
WHERE table_schema = DATABASE()
- """
- )
+ """)
return [
TableInfo(row[0], {"BASE TABLE": "t", "VIEW": "v"}.get(row[1]), row[2])
for row in cursor.fetchall()
diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py
index 07c2d9bded..9089d44695 100644
--- a/django/db/backends/oracle/introspection.py
+++ b/django/db/backends/oracle/introspection.py
@@ -58,8 +58,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_table_list(self, cursor):
"""Return a list of table and view names in the current database."""
- cursor.execute(
- """
+ cursor.execute("""
SELECT
user_tables.table_name,
't',
@@ -78,8 +77,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
SELECT view_name, 'v', NULL FROM user_views
UNION ALL
SELECT mview_name, 'v', NULL FROM user_mviews
- """
- )
+ """)
return [
TableInfo(self.identifier_converter(row[0]), row[1], row[2])
for row in cursor.fetchall()
diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py
index 69bc8712bd..31165ff7cb 100644
--- a/django/db/backends/postgresql/introspection.py
+++ b/django/db/backends/postgresql/introspection.py
@@ -55,8 +55,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_table_list(self, cursor):
"""Return a list of table and view names in the current database."""
- cursor.execute(
- """
+ cursor.execute("""
SELECT
c.relname,
CASE
@@ -70,8 +69,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
WHERE c.relkind IN ('f', 'm', 'p', 'r', 'v')
AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
AND pg_catalog.pg_table_is_visible(c.oid)
- """
- )
+ """)
return [
TableInfo(*row)
for row in cursor.fetchall()
diff --git a/django/db/backends/sqlite3/introspection.py b/django/db/backends/sqlite3/introspection.py
index 780a5e90d4..b74689107b 100644
--- a/django/db/backends/sqlite3/introspection.py
+++ b/django/db/backends/sqlite3/introspection.py
@@ -77,12 +77,10 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
"""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(
- """
+ cursor.execute("""
SELECT name, type FROM sqlite_master
WHERE type in ('table', 'view') AND NOT name='sqlite_sequence'
- ORDER BY name"""
- )
+ ORDER BY name""")
return [TableInfo(row[0], row[1][0]) for row in cursor.fetchall()]
def get_table_description(self, cursor, table_name):