Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved import in db.backends.creation

  • Loading branch information...
commit e486475a13ba626f67008ade3544c74003f0a881 1 parent c44d748
Claude Paroz claudep authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 django/db/backends/creation.py
7 django/db/backends/creation.py
View
@@ -7,6 +7,8 @@
from django.utils.encoding import force_bytes
from django.utils.six.moves import input
+from .util import truncate_name
+
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
@@ -142,8 +144,6 @@ def sql_for_pending_references(self, model, style, pending_references):
"""
Returns any ALTER TABLE statements to add constraints after the fact.
"""
- from django.db.backends.util import truncate_name
-
opts = model._meta
if not opts.managed or opts.proxy or opts.swapped:
return []
@@ -193,8 +193,6 @@ def sql_indexes_for_field(self, model, f, style):
return []
def sql_indexes_for_fields(self, model, fields, style):
- from django.db.backends.util import truncate_name
-
if len(fields) == 1 and fields[0].db_tablespace:
tablespace_sql = self.connection.ops.tablespace_sql(fields[0].db_tablespace)
elif model._meta.db_tablespace:
@@ -241,7 +239,6 @@ def sql_destroy_model(self, model, references_to_delete, style):
return output
def sql_remove_table_constraints(self, model, references_to_delete, style):
- from django.db.backends.util import truncate_name
if not model._meta.managed or model._meta.proxy or model._meta.swapped:
return []
output = []
Please sign in to comment.
Something went wrong with that request. Please try again.