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:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user