1
0
mirror of https://github.com/django/django.git synced 2025-07-05 10:19:20 +00:00

truncate_name if needed

git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4016 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Boulder Sprinters 2006-11-05 01:22:06 +00:00
parent 2245b599a7
commit 93bfe7f18e

View File

@ -632,7 +632,10 @@ class ManyToManyField(RelatedField, Field):
def _get_m2m_db_table(self, opts):
"Function that can be curried to provide the m2m table name for this relation"
return '%s_%s' % (opts.db_table, self.name)
from django.db import backend
from django.db.backends.util import truncate_name
name = '%s_%s' % (opts.db_table, self.name)
return truncate_name(name, backend.get_max_name_length())
def _get_m2m_column_name(self, related):
"Function that can be curried to provide the source column name for the m2m table"