summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2012-02-11 20:53:48 +0000
committerRamiro Morales <cramm0@gmail.com>2012-02-11 20:53:48 +0000
commita411242e947c2c330a87ec5149510114312c8b8d (patch)
treefb03a2208a8d9ed59b96d6eeb6767dd2a7c6fc68 /django
parentccc0e122d42dad0f645407c469383d85bae92048 (diff)
Fixed #17676 -- Fixed introspection of column names that start with digit(s).
Thanks Gandalfar for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17509 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/core/management/commands/inspectdb.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index e81f399788..8da0d7e84f 100644
--- a/django/core/management/commands/inspectdb.py
+++ b/django/core/management/commands/inspectdb.py
@@ -101,8 +101,8 @@ class Command(NoArgsCommand):
att_name += '_field'
comment_notes.append('Field renamed because it was a Python reserved word.')
- if att_name.isdigit():
- att_name = 'number_%d' % int(att_name)
+ if att_name[0].isdigit():
+ att_name = 'number_%s' % att_name
extra_params['db_column'] = unicode(column_name)
comment_notes.append("Field renamed because it wasn't a "
"valid Python identifier.")