1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

boulder-oracle-sprint: Fixed DATA_TYPES_REVERSE to use cx_Oracle type

objects as keys.  Introspection works much better now.


git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Boulder Sprinters 2007-03-29 21:33:36 +00:00
parent 9649bfd4f9
commit 61c3c5bc7f
2 changed files with 11 additions and 15 deletions

View File

@ -883,7 +883,7 @@ def inspectdb():
except NotImplementedError:
indexes = {}
for i, row in enumerate(introspection_module.get_table_description(cursor, table_name)):
att_name = row[0]
att_name = row[0].lower()
comment_notes = [] # Holds Field notes, to be displayed in a Python comment.
extra_params = {} # Holds Field parameters such as 'db_column'.

View File

@ -1,5 +1,7 @@
from django.db.backends.oracle.base import quote_name
import re
import cx_Oracle
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
@ -84,19 +86,13 @@ WHERE allcols.column_name = primarycols.column_name (+) AND
indexes[row[0]] = {'primary_key': row[1], 'unique': row[2]}
return indexes
# Maps type codes to Django Field types.
# Maps type objects to Django Field types.
DATA_TYPES_REVERSE = {
16: 'BooleanField',
21: 'SmallIntegerField',
23: 'IntegerField',
25: 'TextField',
869: 'IPAddressField',
1043: 'CharField',
1082: 'DateField',
1083: 'TimeField',
1114: 'DateTimeField',
1184: 'DateTimeField',
1266: 'TimeField',
1700: 'FloatField',
cx_Oracle.CLOB: 'TextField',
cx_Oracle.DATETIME: 'DateTimeField',
cx_Oracle.FIXED_CHAR: 'CharField',
cx_Oracle.NCLOB: 'TextField',
cx_Oracle.NUMBER: 'FloatField',
cx_Oracle.STRING: 'TextField',
cx_Oracle.TIMESTAMP: 'DateTimeField',
}