mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user