Legacy Database "%" escaping not documented
While creating a model for a legacy database using inspectdb, I was not able to retrieve data from a column where db_column referenced a field with a % i.e. Discount%. Eventually, through the help here http://groups.google.com/group/django-users/browse_thread/thread/162a4e857d15248c I learned that it is necessary to escape the % with a %%, which makes sense overall, but was not obvious in the context of the model design.
The need to escape the % with %% is not documented as far as I can tell and should either be automatic with inspectdb or included in the Integrating Django with a legacy database documentation (I leaning towards the latter). Other such non-obvious (at least for relatively new python and django users) aspects of dealing with a legacy database should also be documented more clearly, perhaps in a Things To Look Out For section for example.
Thank you.
Change History
(8)
Keywords: |
lecacy models.py added
|
Keywords: |
legacy added; lecacy removed
|
Triage Stage: |
Unreviewed → Accepted
|
Component: |
django-admin.py inspectdb → Core (Management commands)
|
Severity: |
→ Normal
|
Type: |
→ Bug
|
Easy pickings: |
unset
|
Keywords: |
inspectdb added
|
UI/UX: |
unset
|
Resolution: |
→ duplicate
|
Status: |
new → closed
|
See #6343 for a potentially related issue.