summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/core/management/commands/inspectdb.py2
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: