diff options
| author | shankarj67 <shankarj67@gmail.com> | 2020-03-06 10:23:52 +0530 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-03-06 08:53:32 +0100 |
| commit | df4d622cac02fcbf98da99e62701a41a521094ca (patch) | |
| tree | a9b061ae7b4ba246706a28aaf224c51f8fb98a6e /django | |
| parent | 17009e910538b9c3709d302f54c2d10eb245cf38 (diff) | |
Fixed #31345 -- Added BaseDatabaseIntrospection.get_relations().
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/backends/base/introspection.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/django/db/backends/base/introspection.py b/django/db/backends/base/introspection.py index d661e1fc0d..10c04abece 100644 --- a/django/db/backends/base/introspection.py +++ b/django/db/backends/base/introspection.py @@ -140,6 +140,17 @@ class BaseDatabaseIntrospection: """ raise NotImplementedError('subclasses of BaseDatabaseIntrospection may require a get_sequences() method') + 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. + """ + raise NotImplementedError( + 'subclasses of BaseDatabaseIntrospection may require a ' + 'get_relations() method.' + ) + def get_key_columns(self, cursor, table_name): """ Backends can override this to return a list of: |
