#16536: inspectdb with numerical column names
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  danodonovan                        |         Status:  new
                   Type:  Bug        |      Component:  Core (Management
              Milestone:             |  commands)
                Version:  SVN        |       Severity:  Normal
             Resolution:             |       Keywords:  inspectdb
           Triage Stage:  Accepted   |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * needs_docs:   => 0
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 This problem is similar to the situation when a database column name is a
 Python reserved word (such as 'pass', 'class' or 'for'). In such cases,
 inspectdb appends '_field' to the column name.

 `'number_%d'` sounds OK to me.

 Could you also add a comment in the generated code: "'Field renamed
 because it wasn't a valid Python identifier."?

 Patch appreciated :)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16536#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to