Opened 18 years ago
Closed 18 years ago
#2517 closed enhancement (fixed)
[patch] add handling of column names with spaces to inspectdb
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | |
Severity: | minor | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
inspectdb does not currently notice when a database table contains a column with embedded spaces in the name. Translating such a name directly to a field name causes a syntax error since a field name cannot contain spaces. I've got a patch that fixes this by simply removing the spaces in the generated name. db_column is set just as it is for DB column names that duplicate Python reserved words.
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | management.diff added |
---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Forgot to mention I tested this patch against my own DB which has tables where some of the column names contain spaces. It seems to work properly.