summaryrefslogtreecommitdiff
path: root/django/db/models/options.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-08-19 23:53:39 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-08-19 23:53:39 +0000
commite4b7e369ddc511dac78e1bf735e927c5fe0afe68 (patch)
tree95748d3b84ed84d61b842e4e3e5ed7cbc596acb3 /django/db/models/options.py
parentd3e69c3a47dd9fc7c36414c029d9919b84b0b822 (diff)
Refactored get_max_name_length() to DatabaseOperations.max_name_length(). Refs #5106
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5960 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/options.py')
-rw-r--r--django/db/models/options.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py
index 8cd9b58ec8..ad813ae0f7 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -63,7 +63,7 @@ class Options(object):
del self.meta
def _prepare(self, model):
- from django.db import backend
+ from django.db import connection
from django.db.backends.util import truncate_name
if self.order_with_respect_to:
self.order_with_respect_to = self.get_field(self.order_with_respect_to)
@@ -79,8 +79,7 @@ class Options(object):
# If the db_table wasn't provided, use the app_label + module_name.
if not self.db_table:
self.db_table = "%s_%s" % (self.app_label, self.module_name)
- self.db_table = truncate_name(self.db_table,
- backend.get_max_name_length())
+ self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
def add_field(self, field):
# Insert the given field in the order in which it was created, using