1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

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
This commit is contained in:
Ramiro Morales
2012-02-11 20:53:48 +00:00
parent ccc0e122d4
commit a411242e94
3 changed files with 21 additions and 2 deletions

View File

@@ -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.")