Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2517 -- Improved inspectdb to handle table column names that c…

…ontain spaces. Thanks, Karen Tracey

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3549 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit caa51f4444338aaf92409ab45b1cbe885389eb2f 1 parent a6a402a
Adrian Holovaty authored August 10, 2006
1  AUTHORS
@@ -131,6 +131,7 @@ answer newbie questions, and generally made Django that much better:
131 131
     Tom Tobin
132 132
     Tom Insam
133 133
     Joe Topjian <http://joe.terrarum.net/geek/code/python/django/>
  134
+    Karen Tracey <graybark@bellsouth.net>
134 135
     Amit Upadhyay
135 136
     Geert Vanderkelen
136 137
     Milton Waddams
4  django/core/management.py
@@ -733,6 +733,10 @@ def table2model(table_name):
733 733
                 extra_params['db_column'] = att_name
734 734
                 att_name += '_field'
735 735
                 comment_notes.append('Field renamed because it was a Python reserved word.')
  736
+            elif ' ' in att_name:
  737
+                extra_params['db_column'] = att_name
  738
+                att_name = att_name.replace(' ', '')
  739
+                comment_notes.append('Field renamed to remove spaces.')
736 740
 
737 741
             if relations.has_key(i):
738 742
                 rel_to = relations[i][1] == table_name and "'self'" or table2model(relations[i][1])

0 notes on commit caa51f4

Please sign in to comment.
Something went wrong with that request. Please try again.