diff options
| author | Tim Graham <timograham@gmail.com> | 2018-07-20 18:09:34 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-07-20 18:23:30 -0400 |
| commit | 45808895c0ecd96e5cc2a19257ee5529a2c80cbf (patch) | |
| tree | 5f291e7bcfad0dcb845d263f2856e741b41723ba | |
| parent | ba83378a7762c51be235b521aa5b48233d6c6c82 (diff) | |
Refs #23919 -- Removed obsolete u-prefix stripping in inspectdb.
| -rw-r--r-- | django/core/management/commands/inspectdb.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py index e44b31f1c5..cc1a6adc54 100644 --- a/django/core/management/commands/inspectdb.py +++ b/django/core/management/commands/inspectdb.py @@ -41,9 +41,6 @@ class Command(BaseCommand): def table2model(table_name): return re.sub(r'[^a-zA-Z0-9]', '', table_name.title()) - def strip_prefix(s): - return s[1:] if s.startswith("u'") else s - with connection.cursor() as cursor: yield "# This is an auto-generated Django model module." yield "# You'll have to do the following manually to clean this up:" @@ -157,9 +154,7 @@ class Command(BaseCommand): if extra_params: if not field_desc.endswith('('): field_desc += ', ' - field_desc += ', '.join( - '%s=%s' % (k, strip_prefix(repr(v))) - for k, v in extra_params.items()) + field_desc += ', '.join('%s=%r' % (k, v) for k, v in extra_params.items()) field_desc += ')' if comment_notes: field_desc += ' # ' + ' '.join(comment_notes) |
