Opened 11 years ago
Closed 10 years ago
#21079 closed Bug (fixed)
Inspectdb doesn't properly translate database table names to valid python names
Reported by: | Michael Manfre | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | 1.5 |
Severity: | Normal | Keywords: | inspectdb |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Given a database with a table named Some.Table, inspectdb will generate a model named Some.Table, instead of something with a valid Python syntax. The same issue was possible with column names in Django 1.4, but was subsequently changed to provide better normalization of column names. The same should happen for table names.
Change History (5)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 11 years ago
https://github.com/django/django/commit/395c6083af93cc37c7d16ef4db451091841cefdc
https://github.com/django/django/commit/f5ea730dac0986b2d48889a2d0fab2c5befb4494
The main fix was changing to use a regex.
comment:4 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Do you have a link to the commit that fixed this for column names? That would be a helpful reference in implementing this.