From b57d86f226ca4fded1fc8bf6300450fb6a0566c1 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Wed, 4 Mar 2009 05:40:22 +0000 Subject: [1.0.X] Changed the row count value returned from update queries in some cases. If an update only affected an ancestor model (not the child), we were returning 0 for the number of rows updated. This could have been misleading if the value is used to detect an update occuring. So we now return the rowcount from the first non-trivial query that is executed (if any). Still a slight compromise, but better than what we had. Backport of r9966 from trunk (turns out this *is* a bugfix, since the returned rowcount is used in Model.save(force_update=True)). git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9969 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/model_inheritance_regress/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/regressiontests/model_inheritance_regress/models.py b/tests/regressiontests/model_inheritance_regress/models.py index 9a893924d2..b5c051d5ca 100644 --- a/tests/regressiontests/model_inheritance_regress/models.py +++ b/tests/regressiontests/model_inheritance_regress/models.py @@ -271,8 +271,8 @@ True # (regression test for #10362). >>> article = ArticleWithAuthor.objects.create(author="fred", headline="Hey there!", pub_date = datetime.datetime(2009, 3, 1, 8, 0, 0)) >>> ArticleWithAuthor.objects.filter(author="fred").update(headline="Oh, no!") -0 +1 >>> ArticleWithAuthor.objects.filter(pk=article.pk).update(headline="Oh, no!") -0 +1 """} -- cgit v1.3