Changes between Initial Version and Version 1 of Ticket #37203


Ignore:
Timestamp:
Jul 5, 2026, 12:20:39 PM (3 weeks ago)
Author:
David Smith
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #37203 – Description

    initial v1  
    1 inspectdb generates Python model source from database metadata. Most generated metadata already uses repr-style escaping, but two paths still interpolate database-provided values directly into generated
    2      source text:
     1inspectdb generates Python model source from database metadata. Most generated metadata already uses repr-style escaping, but two paths still interpolate database-provided values directly into generated source text:
    32
    43     * composite primary-key column names in models.CompositePrimaryKey(...)
    54     * table names and exception messages emitted in introspection-error comments
    65
    7      This can produce invalid or unintended generated model code for unusual database schemas containing quotes or newlines.
     6This can produce invalid or unintended generated model code for unusual database schemas containing quotes or newlines.
    87
    9      Proposed fix:
     8Proposed fix:
    109     * render CompositePrimaryKey column names with repr()
    1110     * render introspection-error table names/messages with repr-style output
    1211     * add regression tests for both paths
    1312
    14      A pull request with tests is available:
    15      https://github.com/django/django/pull/21581
     13A pull request with tests is available:
     14https://github.com/django/django/pull/21581
Back to Top