diff options
| author | Ian Kelly <ian.g.kelly@gmail.com> | 2008-12-02 16:58:06 +0000 |
|---|---|---|
| committer | Ian Kelly <ian.g.kelly@gmail.com> | 2008-12-02 16:58:06 +0000 |
| commit | 485316017a34623bb883f57bc72417e84722912b (patch) | |
| tree | cfcaccb885d3fc6a918767393eb3016b1d0335b1 | |
| parent | 9a4f1760fdf9d131e3fc0cca2935b7a57ba30f88 (diff) | |
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/trunk@9546 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/db/backends/__init__.py | 2 | ||||
| -rw-r--r-- | django/db/models/fields/related.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py index 9eb9729ea7..353eb39488 100644 --- a/django/db/backends/__init__.py +++ b/django/db/backends/__init__.py @@ -404,7 +404,7 @@ class BaseDatabaseIntrospection(object): tables.add(model._meta.db_table) tables.update([f.m2m_db_table() for f in model._meta.local_many_to_many]) if only_existing: - tables = [t for t in tables if t in self.table_names()] + tables = [t for t in tables if self.table_name_converter(t) in self.table_names()] return tables def installed_models(self, tables): 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" |
