1
0
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:
Claude Paroz
2013-01-12 21:10:08 +01:00
parent 17f8496fea
commit 223fc8eaf9
5 changed files with 15 additions and 8 deletions

View File

@@ -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):