summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2021-11-10 00:21:36 -0500
committerGitHub <noreply@github.com>2021-11-10 06:21:36 +0100
commitafea68ca51c20b726d3b97aaffdfe4e3b632e435 (patch)
treecc7dde720eeb082200b3124425e6fad2934ef354
parent6bc437c0d82675ebe6aa92c8e249892205c316ef (diff)
Fixed DatabaseIntrospection.get_relations() docstring.
The foreign keys are "in" the given table, not "to" it.
-rw-r--r--django/db/backends/base/introspection.py5
-rw-r--r--django/db/backends/mysql/introspection.py2
-rw-r--r--django/db/backends/oracle/introspection.py2
-rw-r--r--django/db/backends/postgresql/introspection.py2
-rw-r--r--django/db/backends/sqlite3/introspection.py2
5 files changed, 6 insertions, 7 deletions
diff --git a/django/db/backends/base/introspection.py b/django/db/backends/base/introspection.py
index c8b0e90873..8e9f5c751f 100644
--- a/django/db/backends/base/introspection.py
+++ b/django/db/backends/base/introspection.py
@@ -146,9 +146,8 @@ class BaseDatabaseIntrospection:
def get_relations(self, cursor, table_name):
"""
- Return a dictionary of
- {field_name: (field_name_other_table, other_table)} representing all
- relationships to the given table.
+ Return a dictionary of {field_name: (field_name_other_table, other_table)}
+ representing all foreign keys in the given table.
"""
raise NotImplementedError(
'subclasses of BaseDatabaseIntrospection may require a '
diff --git a/django/db/backends/mysql/introspection.py b/django/db/backends/mysql/introspection.py
index 2383c9ca1b..4e2fa3ce27 100644
--- a/django/db/backends/mysql/introspection.py
+++ b/django/db/backends/mysql/introspection.py
@@ -151,7 +151,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_relations(self, cursor, table_name):
"""
Return a dictionary of {field_name: (field_name_other_table, other_table)}
- representing all relationships to the given table.
+ representing all foreign keys in the given table.
"""
constraints = self.get_key_columns(cursor, table_name)
relations = {}
diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py
index fa7a34ed0a..1fb26cba49 100644
--- a/django/db/backends/oracle/introspection.py
+++ b/django/db/backends/oracle/introspection.py
@@ -184,7 +184,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_relations(self, cursor, table_name):
"""
Return a dictionary of {field_name: (field_name_other_table, other_table)}
- representing all relationships to the given table.
+ representing all foreign keys in the given table.
"""
table_name = table_name.upper()
cursor.execute("""
diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py
index 4e35cb9e97..5a50ee68b7 100644
--- a/django/db/backends/postgresql/introspection.py
+++ b/django/db/backends/postgresql/introspection.py
@@ -119,7 +119,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_relations(self, cursor, table_name):
"""
Return a dictionary of {field_name: (field_name_other_table, other_table)}
- representing all relationships to the given table.
+ representing all foreign keys in the given table.
"""
return {row[0]: (row[2], row[1]) for row in self.get_key_columns(cursor, table_name)}
diff --git a/django/db/backends/sqlite3/introspection.py b/django/db/backends/sqlite3/introspection.py
index ce097dbd72..f1f33579b9 100644
--- a/django/db/backends/sqlite3/introspection.py
+++ b/django/db/backends/sqlite3/introspection.py
@@ -115,7 +115,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_relations(self, cursor, table_name):
"""
Return a dictionary of {field_name: (field_name_other_table, other_table)}
- representing all relationships to the given table.
+ representing all foreign keys in the given table.
"""
# Dictionary of relations to return
relations = {}