Ticket #5643: patch-inspectdb-columncase.diff
File patch-inspectdb-columncase.diff, 1.3 KB (added by , 17 years ago) |
---|
-
django/core/management/commands/inspectdb.py
48 48 extra_params = {} # Holds Field parameters such as 'db_column'. 49 49 50 50 if ' ' in att_name: 51 extra_params['db_column'] = att_name51 extra_params['db_column'] = row[0] 52 52 att_name = att_name.replace(' ', '') 53 53 comment_notes.append('Field renamed to remove spaces.') 54 54 if keyword.iskeyword(att_name): 55 extra_params['db_column'] = att_name55 extra_params['db_column'] = row[0] 56 56 att_name += '_field' 57 57 comment_notes.append('Field renamed because it was a Python reserved word.') 58 if att_name != row[0] and (not extra_params.has_key('db_column')): 59 extra_params['db_column'] = row[0] 60 comment_notes.append('Field renamed because of uppercase characters.') 58 61 59 62 if i in relations: 60 63 rel_to = relations[i][1] == table_name and "'self'" or table2model(relations[i][1])