1 | 22,34d21
|
---|
2 | <
|
---|
3 | < def get_table_description(self, cursor, table_name):
|
---|
4 | < "Returns a description of the table, with the DB-API cursor.description interface."
|
---|
5 | < quote_name = self.connection.ops.quote_name
|
---|
6 | < cursor.execute("SELECT column_name, is_nullable FROM information_schema.columns WHERE table_name = '%s'" % table_name)
|
---|
7 | < nullmap = dict(cursor.fetchall())
|
---|
8 | < cursor.execute("SELECT * FROM %s WHERE 1=0" % quote_name(table_name))
|
---|
9 | < def fixdesc(row,nullmap=nullmap):
|
---|
10 | < ret = list(row)
|
---|
11 | < ret[6] = nullmap[unicode(ret[0])] == u'YES'
|
---|
12 | < return tuple(ret)
|
---|
13 | < return map(fixdesc, cursor.description)
|
---|
14 | <
|
---|