#12460: inspectdb and field names ending with underscores
---------------------------------------------------------+------------------
          Reporter:  3gun <[email protected]>  |         Owner:  
nobody                                
            Status:  new                                 |     Milestone:       
                                 
         Component:  django-admin.py inspectdb           |       Version:  1.1  
                                 
        Resolution:                                      |      Keywords:  
inspectdb underscore characters digits
             Stage:  Accepted                            |     Has_patch:  0    
                                 
        Needs_docs:  0                                   |   Needs_tests:  0    
                                 
Needs_better_patch:  0                                   |  
---------------------------------------------------------+------------------
Changes (by elijahr):

  * keywords:  inspectdb underscore => inspectdb underscore characters
               digits

Comment:

 There are a few other scenarios where invalid field names could be
 generated via the inspectdb command.  For instance, a column name of
 "Foo/Bar", while unconventional, is a valid column name, at least in MySQL
 5, but the invalid field name of 'foo/bar' would be generated.

 Currently, inspectdb ensures that:
 - field names do not contain spaces or dashes
 - field names are not Python keywords

 The patch I just attached improves this by also ensuring that:
 - field names do not contain any characters outside of a-zA-Z0-9_
 - field names do not contain double underscores
 - field names neither start nor end with underscores
 - field names do not start with digits

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12460#comment:3>
Django <http://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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to