From 93bfe7f18e4ccb2c13d5ed14a0a71c5f0c94dd63 Mon Sep 17 00:00:00 2001 From: Boulder Sprinters Date: Sun, 5 Nov 2006 01:22:06 +0000 Subject: truncate_name if needed git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4016 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/fields/related.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'django') diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index bd9262d55a..ad78a01252 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -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" -- cgit v1.2.1