mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Return namedtuple from get_table_description
We don't make use of it currently to not break third-party db backends.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import re
|
||||
from django.db.backends import BaseDatabaseIntrospection
|
||||
from django.db.backends import BaseDatabaseIntrospection, FieldInfo
|
||||
|
||||
field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
|
||||
|
||||
@@ -60,7 +60,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||
|
||||
def get_table_description(self, cursor, table_name):
|
||||
"Returns a description of the table, with the DB-API cursor.description interface."
|
||||
return [(info['name'], info['type'], None, info['size'], None, None,
|
||||
return [FieldInfo(info['name'], info['type'], None, info['size'], None, None,
|
||||
info['null_ok']) for info in self._table_info(cursor, table_name)]
|
||||
|
||||
def get_relations(self, cursor, table_name):
|
||||
|
||||
Reference in New Issue
Block a user