diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2009-04-13 07:07:51 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2009-04-13 07:07:51 +0000 |
| commit | fd3ee7d7867dd13a336b90873ccb8df6302f2c05 (patch) | |
| tree | 16aae299cabe6a7c7e7f5d2f773f605f1965206e /django/db/backends/__init__.py | |
| parent | 0fec0a5d704d487755209115719ca173913a43b7 (diff) | |
Fixed #9804 -- Corrected the introspection of sequence names. This was causing problems when flushing tables that had many-to-many relations through an inherited table. Thanks to jdimov for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10552 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/__init__.py')
| -rw-r--r-- | django/db/backends/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py index 98360d081d..579bf80aaf 100644 --- a/django/db/backends/__init__.py +++ b/django/db/backends/__init__.py @@ -530,7 +530,10 @@ class BaseDatabaseIntrospection(object): break # Only one AutoField is allowed per model, so don't bother continuing. for f in model._meta.local_many_to_many: - sequence_list.append({'table': f.m2m_db_table(), 'column': None}) + # If this is an m2m using an intermediate table, + # we don't need to reset the sequence. + if f.rel.through is None: + sequence_list.append({'table': f.m2m_db_table(), 'column': None}) return sequence_list |
