* keywords: => inspectdb
* ui_ux: => 0
* easy: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/6344#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by WoLpH):
So... it's been 6 and a half years now, any progress on this?
After trying the inspectdb command I still notice a few issues that would
be great to have fixed. For example the field `printableStyleTemplateId`
should be named `printable_style_template_id` instead of
`printablestyletemplateid`. Or maybe even `printable_style_template`, but
something smarter at least :)
--
Ticket URL: <https://code.djangoproject.com/ticket/6344#comment:9>
* status: new => closed
* resolution: => wontfix
Comment:
Things have changed a lot since that report. I'm closing it now, but that
doesn't mean the patch didn't contain interesting ideas. If anyone still
want to suggest improvements, please open a new ticket with an updated
patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/6344#comment:10>
Comment (by sur0g):
Although a lot of thing have changed, inspectdb still lacks normal column
naming as of 2.2 version. I've made a small fix for this, but things
remain unchanged in master repo of course.
Original table:
{{{
`idbalance_min` INT(11) NOT NULL,
`goods_GoodID` INT(11) NOT NULL,
`clients_ClientID` INT(11) NOT NULL,
`BalanceMinM` DECIMAL(10,0) NULL DEFAULT NULL,
`BalanceMinA` DECIMAL(10,0) NULL DEFAULT NULL,
`QtyPeriod` DECIMAL(10,0) NULL DEFAULT NULL,
`AVG` DECIMAL(10,0) NULL DEFAULT NULL,
`STD` DECIMAL(10,0) NULL DEFAULT NULL,
}}}
Resulting weird names:
{{{
idbalance_min = models.IntegerField(...)
goods_goodid = models.ForeignKey(...)
clients_clientid = models.ForeignKey(...)
balanceminm = models.DecimalField(...)
balancemina = models.DecimalField(...)
qtyperiod = models.DecimalField(...)
avg = models.DecimalField(...)
std = models.DecimalField(...)
}}}
Fields after a small patch:
{{{
idbalance_min = models.IntegerField(...)
goods_good = models.ForeignKey(...)
clients_client = models.ForeignKey(...)
balance_min_m = models.DecimalField(...)
balance_min_a = models.DecimalField(...)
qty_period = models.DecimalField(...)
avg = models.DecimalField(...)
std = models.DecimalField(...)
}}}
A few notes here:
1. Trailing ID is trimmed for the FK
2. camelCase & PascalCase are handled properly (snake_case)
Should I contribute?
--
Ticket URL: <https://code.djangoproject.com/ticket/6344#comment:11>