mirror of https://github.com/django/django.git
Fixed #31333 -- Added BaseDatabaseIntrospection.get_table_description().
This commit is contained in:
parent
6dea42feba
commit
427a7e419b
|
@ -54,6 +54,16 @@ class BaseDatabaseIntrospection:
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError('subclasses of BaseDatabaseIntrospection may require a get_table_list() method')
|
raise NotImplementedError('subclasses of BaseDatabaseIntrospection may require a get_table_list() method')
|
||||||
|
|
||||||
|
def get_table_description(self, cursor, table_name):
|
||||||
|
"""
|
||||||
|
Return a description of the table with the DB-API cursor.description
|
||||||
|
interface.
|
||||||
|
"""
|
||||||
|
raise NotImplementedError(
|
||||||
|
'subclasses of BaseDatabaseIntrospection may require a '
|
||||||
|
'get_table_description() method.'
|
||||||
|
)
|
||||||
|
|
||||||
def get_migratable_models(self):
|
def get_migratable_models(self):
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
from django.db import router
|
from django.db import router
|
||||||
|
|
|
@ -16,6 +16,11 @@ class SimpleDatabaseIntrospectionTests(SimpleTestCase):
|
||||||
with self.assertRaisesMessage(NotImplementedError, msg):
|
with self.assertRaisesMessage(NotImplementedError, msg):
|
||||||
self.introspection.get_table_list(None)
|
self.introspection.get_table_list(None)
|
||||||
|
|
||||||
|
def test_get_table_description(self):
|
||||||
|
msg = self.may_require_msg % 'get_table_description'
|
||||||
|
with self.assertRaisesMessage(NotImplementedError, msg):
|
||||||
|
self.introspection.get_table_description(None, None)
|
||||||
|
|
||||||
def test_get_sequences(self):
|
def test_get_sequences(self):
|
||||||
msg = self.may_require_msg % 'get_sequences'
|
msg = self.may_require_msg % 'get_sequences'
|
||||||
with self.assertRaisesMessage(NotImplementedError, msg):
|
with self.assertRaisesMessage(NotImplementedError, msg):
|
||||||
|
|
Loading…
Reference in New Issue