diff options
| author | Ian Kelly <ian.g.kelly@gmail.com> | 2008-12-02 16:59:39 +0000 |
|---|---|---|
| committer | Ian Kelly <ian.g.kelly@gmail.com> | 2008-12-02 16:59:39 +0000 |
| commit | 4c7efda28ff2e382efc92cdfc83cd8d9272c6a34 (patch) | |
| tree | b5cfcb1ac76aae720142d7ebf2f70ed92fc3e750 /django/db/models/fields | |
| parent | af6b7cdc6332299d04d90154123afc6ac6bc5ec9 (diff) | |
[1.0.X] Fixed a pair of bugs in determining the set of models to flush that were causing test cause failures in Oracle after [9536].
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9547 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/fields')
| -rw-r--r-- | django/db/models/fields/related.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index 1763bf2523..c87b823a69 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -1,4 +1,5 @@ from django.db import connection, transaction +from django.db.backends import util from django.db.models import signals, get_model from django.db.models.fields import AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist from django.db.models.related import RelatedObject @@ -771,7 +772,8 @@ class ManyToManyField(RelatedField, Field): elif self.db_table: return self.db_table else: - return '%s_%s' % (opts.db_table, self.name) + return util.truncate_name('%s_%s' % (opts.db_table, self.name), + connection.ops.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" |
