summaryrefslogtreecommitdiff
path: root/django/core/management/commands/inspectdb.py
diff options
context:
space:
mode:
authorKevin Kubasik <kevin@kubasik.net>2009-09-08 17:36:43 +0000
committerKevin Kubasik <kevin@kubasik.net>2009-09-08 17:36:43 +0000
commit3de5792e13d777c2beedea11bcc308f6c9df4ff9 (patch)
tree88a433f78b5f77ab1964162594d25f6a59e7a5d9 /django/core/management/commands/inspectdb.py
parente2d14c075a51eb1f0b832765df8723d82f0afac4 (diff)
parentbb9cc01b132dbde2461191dbb1035eaae4885051 (diff)
[gsoc2009-testing] Massive merge update to trunk. This is to prep for uploadarchive/soc2009/test-improvements
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/test-improvements@11480 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/management/commands/inspectdb.py')
-rw-r--r--django/core/management/commands/inspectdb.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index f30a00b7b2..54203c532b 100644
--- a/django/core/management/commands/inspectdb.py
+++ b/django/core/management/commands/inspectdb.py
@@ -15,8 +15,9 @@ class Command(NoArgsCommand):
def handle_inspection(self):
from django.db import connection
import keyword
-
- table2model = lambda table_name: table_name.title().replace('_', '').replace(' ', '').replace('-', '')
+
+ table2model = lambda table_name: table_name.title()
+ .replace('_', '').replace(' ', '').replace('-', '').replace('*','_').replace(',','_')
cursor = connection.cursor()
yield "# This is an auto-generated Django model module."
@@ -73,7 +74,7 @@ class Command(NoArgsCommand):
extra_params['db_column'] = column_name
else:
try:
- field_type = connection.introspection.data_types_reverse[row[1]]
+ field_type = connection.introspection.get_field_type(row[1], row)
except KeyError:
field_type = 'TextField'
comment_notes.append('This field type is a guess.')