From cb0a57fc8b429c1d3c2146984b795b8e31f32b34 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 3 Mar 2006 10:20:35 +0000 Subject: [PATCH] magic-removal: Fixes #1459 -- Modified the way the row count is compared to accommodate SQLite. Thanks, Malcolm Tredinnick. git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2478 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/fields/related.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index f1dce24e43..461a4ec162 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -221,7 +221,7 @@ def _add_m2m_items(rel_manager_inst, managerclass, rel_model, join_table, source (target_col_name, join_table, source_col_name, target_col_name, ",".join(['%s'] * len(new_ids))), [source_pk_val] + list(new_ids)) - if cursor.rowcount is not None and cursor.rowcount > 0: + if cursor.rowcount is not None and cursor.rowcount != 0: existing_ids = set([row[0] for row in cursor.fetchmany(cursor.rowcount)]) else: existing_ids = set()