﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1459	[patch] [magic-removal] m2m problems with SQLite	matt	Adrian Holovaty	"I get three failing m2m-related tests on magic-removal [2475] using OSX 10.4.5, SQLite 3.1.3 and PySQLite 2.0.7:

{{{
'm2m_recursive' module: API test raised an exception
====================================================
Code: 'b.friends.add(a)'
Line: 34
Exception:   File ""/Users/mcroydon/django/django_magic/tests/doctest.py"", line 1243, in __run
    compileflags, 1) in test.globs
  File ""<doctest m2m_recursive[14]>"", line 1, in ?
    b.friends.add(a)
  File ""/Users/mcroydon/django/django_magic/django/db/models/fields/related.py"", line 365, in add
    target_col_name, instance._get_pk_val(), *objs)
  File ""/Users/mcroydon/django/django_magic/django/db/models/fields/related.py"", line 233, in _add_m2m_items
    [source_pk_val, obj_id])
  File ""/Users/mcroydon/django/django_magic/django/db/backends/util.py"", line 11, in execute
    result = self.cursor.execute(sql, params)
  File ""/Users/mcroydon/django/django_magic/django/db/backends/sqlite3/base.py"", line 63, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: columns from_person_id, to_person_id are not unique


'm2m_recursive' module: API test raised an exception
====================================================
Code: 'b.stalkers.add(a)'
Line: 115
Exception:   File ""/Users/mcroydon/django/django_magic/tests/doctest.py"", line 1243, in __run
    compileflags, 1) in test.globs
  File ""<doctest m2m_recursive[35]>"", line 1, in ?
    b.stalkers.add(a)
  File ""/Users/mcroydon/django/django_magic/django/db/models/fields/related.py"", line 307, in add
    target_col_name, instance._get_pk_val(), *objs)
  File ""/Users/mcroydon/django/django_magic/django/db/models/fields/related.py"", line 233, in _add_m2m_items
    [source_pk_val, obj_id])
  File ""/Users/mcroydon/django/django_magic/django/db/backends/util.py"", line 11, in execute
    result = self.cursor.execute(sql, params)
  File ""/Users/mcroydon/django/django_magic/django/db/backends/sqlite3/base.py"", line 63, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: columns from_person_id, to_person_id are not unique


'many_to_many' module: API test raised an exception
===================================================
Code: 'a2.publications.add(p3)'
Line: 23
Exception:   File ""/Users/mcroydon/django/django_magic/tests/doctest.py"", line 1243, in __run
    compileflags, 1) in test.globs
  File ""<doctest many_to_many[13]>"", line 1, in ?
    a2.publications.add(p3)
  File ""/Users/mcroydon/django/django_magic/django/db/models/fields/related.py"", line 365, in add
    target_col_name, instance._get_pk_val(), *objs)
  File ""/Users/mcroydon/django/django_magic/django/db/models/fields/related.py"", line 233, in _add_m2m_items
    [source_pk_val, obj_id])
  File ""/Users/mcroydon/django/django_magic/django/db/backends/util.py"", line 11, in execute
    result = self.cursor.execute(sql, params)
  File ""/Users/mcroydon/django/django_magic/django/db/backends/sqlite3/base.py"", line 63, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: columns article_id, publication_id are not unique
}}}"	defect	closed	Database layer (models, ORM)	magic-removal	normal	fixed			Unreviewed	1	0	0	0	0	0
