diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-07-05 20:48:57 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-07-06 21:19:27 +0200 |
| commit | b144bfb5ce1e3e283c7fddac29a4653c6bc7fb3f (patch) | |
| tree | fdc4a0e9b491aa5cfa07549126c97497456b9b44 /django | |
| parent | 2572c07cc64177e985b453d0f0b819e85fe080cc (diff) | |
Fixed #21079 -- Further normalized table names in inspectdb
Thanks Michael Manfre for the report and Tim Graham for the review.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/inspectdb.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py index 7feef23b08..91aa3255d7 100644 --- a/django/core/management/commands/inspectdb.py +++ b/django/core/management/commands/inspectdb.py @@ -32,7 +32,7 @@ class Command(BaseCommand): # 'table_name_filter' is a stealth option table_name_filter = options.get('table_name_filter') - table2model = lambda table_name: table_name.title().replace('_', '').replace(' ', '').replace('-', '') + table2model = lambda table_name: re.sub(r'[^a-zA-Z0-9]', '', table_name.title()) strip_prefix = lambda s: s[1:] if s.startswith("u'") else s with connection.cursor() as cursor: |
