From b144bfb5ce1e3e283c7fddac29a4653c6bc7fb3f Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 5 Jul 2014 20:48:57 +0200 Subject: Fixed #21079 -- Further normalized table names in inspectdb Thanks Michael Manfre for the report and Tim Graham for the review. --- django/core/management/commands/inspectdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django') 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: -- cgit v1.3