Ticket #16536: inspectdb_numeric_fields_16536.diff

File inspectdb_numeric_fields_16536.diff, 884 bytes (added by teraom, 4 years ago)
  • django/core/management/commands/inspectdb.py

     
    101101                    att_name += '_field'
    102102                    comment_notes.append('Field renamed because it was a Python reserved word.')
    103103
     104                if att_name.isdigit():
     105                    att_name = 'number_%d' % att_name
     106                    comment_notes.append('Field renamed because it wasn\'t a \
     107                    valid Python identifier')
     108
    104109                # Don't output 'id = meta.AutoField(primary_key=True)', because
    105110                # that's assumed if it doesn't exist.
    106111                if att_name == 'id' and field_type == 'AutoField(' and extra_params == {'primary_key': True}:
Back to Top