1
0
mirror of https://github.com/django/django.git synced 2024-12-23 17:46:27 +00:00
django/tests
Malcolm Tredinnick 7d9b29a56d Use plain model.Manager, or suitable proxy, for model saving.
We can't use the default manager in Model.save_base(), since we need to
retrieve existing objects which might be filtered out by that manager. We now
always use a plain Manager instance at that point (or something that can
replace it, such as a GeoManager), making all existing rows in the
database visible to the saving code.

The logic for detecting a "suitable replacement" plain base is the same as for
related fields: if the use_for_related_fields is set on the manager subclass,
we can use it. The general requirement here is that we want a base class that
returns the appropriate QuerySet subclass, but does not restrict the rows
returned.

Fixed #8990, #9527.

Refs #2698 (which is not fixed by this change, but it's the first part of a
larger change to fix that bug.)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10056 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-15 03:41:33 +00:00
..
modeltests Fixed #10250 -- Added a regression test to ensure that GROUP BY statements are correctly quoted under MySQL. This appears to have been corrected inadvertently since the original report, but the extra regression test will make sure it stays that way. 2009-03-12 11:52:55 +00:00
regressiontests Use plain model.Manager, or suitable proxy, for model saving. 2009-03-15 03:41:33 +00:00
templates
runtests.py Fixed #10165 -- Use settings.TEST_RUNNER in runtests.py 2009-02-28 04:46:38 +00:00
urls.py Cleaned up and refactored ModelAdmin.formfield_for_dbfield: 2009-01-16 15:32:31 +00:00