Changes between Initial Version and Version 1 of Ticket #37203
- Timestamp:
- Jul 5, 2026, 12:20:39 PM (3 weeks ago)
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: 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 source text: 3 2 4 3 * composite primary-key column names in models.CompositePrimaryKey(...) 5 4 * table names and exception messages emitted in introspection-error comments 6 5 7 This can produce invalid or unintended generated model code for unusual database schemas containing quotes or newlines.6 This can produce invalid or unintended generated model code for unusual database schemas containing quotes or newlines. 8 7 9 Proposed fix:8 Proposed fix: 10 9 * render CompositePrimaryKey column names with repr() 11 10 * render introspection-error table names/messages with repr-style output 12 11 * add regression tests for both paths 13 12 14 A pull request with tests is available:15 https://github.com/django/django/pull/2158113 A pull request with tests is available: 14 https://github.com/django/django/pull/21581