6776 Commits

Author SHA1 Message Date
Malcolm Tredinnick
8a0a17628b [1.0.X] Clarified and expanded documentation for Manager.use_for_related_fields.
This is for Manager subclasses that are default managers, but only
sometimes.  The general rule is: "don't use it." If you really need it,
read the instructions.

Backport of r10057 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10060 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-15 03:45:56 +00:00
Malcolm Tredinnick
97321c7645 [1.0.X] 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.)

Backport of r10056 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10059 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-15 03:45:32 +00:00
Ian Kelly
0eac35ce11 [1.0.X] Fixed #10488: fixed DB cache backend test failures in Oracle. Backport of [10051] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10052 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-13 21:07:41 +00:00
Ian Kelly
0ced9f68f3 [1.0.X] Fixed #10238: coerce TextField values to unicode in the oracle backend. Backport of [10049] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10050 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-13 19:58:56 +00:00
Malcolm Tredinnick
6922925abc [1.0.X] Fixed a problem from r10038. Fixed #10470.
Backport of r10040 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10041 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-12 08:00:46 +00:00
Malcolm Tredinnick
a02247ff73 [1.0.X] Fixed #10472 -- Fixed a race condition in reverse URL resolving.
This only shows up in for reverse() (not forwards resolving), since that
path uses a globally shared resolver object. Based on a patch from
Travis Terry.

Backport of r10037 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10039 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-12 07:37:37 +00:00
Malcolm Tredinnick
fdde600f42 [1.0.X] Fixed #10470 -- Fixed a race condition in middleware initialization.
Thanks to Travis Terry and mrts.

Backport of r10036 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10038 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-12 07:37:08 +00:00
Ian Kelly
75cc96bc6f [1.0.X] Backport of [10024] from trunk. Refs #10443: Added Oracle to the #10443 regression test exemption, since we don't yet support it.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10025 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 22:50:37 +00:00
Ian Kelly
9a5942cd60 [1.0.X] Backport of 10022 from trunk. Added savepoint support to the Oracle backend, necessary per the thread at http://groups.google.com/group/django-developers/browse_thread/thread/c87cf2d97478c068/
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10023 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 18:38:45 +00:00
Russell Keith-Magee
6ab4b64bd0 [1.0.X] Updated svnmerge properties for some recent updates.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10020 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 12:18:39 +00:00
Russell Keith-Magee
ee0320f634 [1.0.X] Fixed #10271, #10281 -- Fixed the handling multiple inline models that share a common base class and have the link to the inline parent on the base class. Includes modifications that allow the equivalent handling for GenericFields. Thanks to Idan Gazit, Antti Kaihola (akaihola), and Alex Gaynor for their work on this patch.
Backport of r10017 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10019 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 12:08:17 +00:00
Malcolm Tredinnick
ea350187a5 [1.0.X] Fixed #10439 -- Fixed a subtle test failure caused by r9995.
Thanks to Ramiro Morales for debugging what was going on here.

Backport of r10015 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10016 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 05:55:55 +00:00
Malcolm Tredinnick
c545e88b81 [1.0.X] Fixed #10443 -- Fixed model attribute updating after r10004.
Adding a get_db_prep_save() call to the UpdateQuery code path meant it
was being called twice if you updated an existing model attribute. This
change removes that double call and also makes TimeField.to_python() a
little more robust for the benefit of the Oracle backend (just in case).

Backport of r10013 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10014 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 05:26:40 +00:00
Jannis Leidel
9c770e05d4 [1.0.X] Updates German translation, fixes #10444
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10010 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 16:44:50 +00:00
Malcolm Tredinnick
6fe80b2a93 [1.0.X] Pass values through get_db_prep_save() in a QuerySet.update() call.
This removes a long-standing FIXME in the update() handling and allows for
greater flexibility in the values passed in. In particular, it brings updates
into line with saves for django.contrib.gis fields, so fixed #10411.

Thanks to Justin Bronn and Russell Keith-Magee for help with this patch.

Backport of r10003 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10004 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 00:07:50 +00:00
Malcolm Tredinnick
b1fd7650a9 [1.0.X] Fixed #9626 -- Fixed a deletion race in the locmem cache.
Backport of r9998 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10001 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 10:02:23 +00:00
Malcolm Tredinnick
055c01103d [1.0.x] Fixed #9508 -- Added an appropriate FileField.__hash__ implementation.
Required because we declare a custom __eq__ method.

Backport of r9997 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 10:01:59 +00:00
Malcolm Tredinnick
244bb7e601 [1.0.X] Fixed #9469 -- Apply the fix from r9189 to the WSGI handler as well.
This is a defensive encoding fix. No functionality change for correct URLs.
Patch from magneto.

Backport of r9996 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9999 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 10:01:22 +00:00
Malcolm Tredinnick
7dcf651bc5 [1.0.X] Fixed #9323 -- Allow glob loading in INSTALLED_APPS to handle digits in names.
Patch from carljm.

Backport of r9994 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9995 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 09:41:37 +00:00
Malcolm Tredinnick
34b530fce7 [1.0.X] Fixed #9399 -- Added StopFutureHandlers to export list in file handling.
Thanks, George Vilches.

Backport of r9992 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9993 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 09:33:14 +00:00
Karen Tracey
8baac83f30 [1.0.X] Updated svnmerge integrated metadata to include changesets merged via other means.
Branch is up-to-date with trunk fixes.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9991 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 05:33:30 +00:00
Karen Tracey
20973954da [1.0.X] Block translation updates and one more new function fix from merge to branch.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9990 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 04:52:07 +00:00
Karen Tracey
9c5eafe7d5 [1.0.X] Block new function (and fixes to same) from snvmerge.py consideration.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9988 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 04:12:56 +00:00
Malcolm Tredinnick
fd5d0cdebb [1.0.X] Fixed #10432 -- Handle all kinds of iterators in queryset filters.
Only consumes the iterators once and works with Python 2.3.

Backport of r9986 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 03:37:47 +00:00
Malcolm Tredinnick
84b890b66e [1.0.X] Fixed #9649 -- Better error handling in model creation.
Previously, you could explicitly assign None to a non-null ForeignKey
(or other) field when creating the model (Child(parent=None), etc). We
now throw an exception when you do that, which matches the behaviour
when you assign None to the attribute after creation.

Thanks to ales.zoulek@gmail.com and ondrej.kohout@gmail.com for some
analysis of this problem.

Backport of r9983 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9984 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-06 04:53:33 +00:00
Malcolm Tredinnick
dd5300274f [1.0.X] Fixed #6710 -- Made DATABASE_OPTIONS work with postgresql_psycopg2 backend.
Thanks to rcoup for the patch.

Backport of r9981 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9982 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-06 02:38:38 +00:00
Malcolm Tredinnick
31e059c9b3 [1.0.X] Improved table join handling for comparisons against NULL.
This fixes a broad class of bugs involving filters that look for missing
related models and fields. Most of them don't seem to have been reported
(the added tests cover the root cause). The exception is that this has
also fixed #9968.

Backport of r9979 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-06 02:09:59 +00:00
Ian Kelly
de442c3ab6 [1.0.X] Clarified documentation regarding Oracle's treatment of nulls and empty strings. Backport of [9976] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-05 20:22:54 +00:00
Malcolm Tredinnick
79f53b4f20 [1.0.X] Made it explicit if you accidentally override a Field from a parent model.
This was always not working reliably (model initialization and serialization
were two of the problems). Now, it's an explicit error. Also, documented.

Fixed #10252.

Backport of r9974 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9975 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 10:40:50 +00:00
Malcolm Tredinnick
182301c8df [1.0.X] Fixed #10406 -- Fixed some problems with model inheritance and pk fields.
Manually specifying both a OneToOneField(parent_link=True) and separate a
primary key field was causing invalid SQL to be generated. Thanks to Ramiro
Morales for some analysis on this one.

Backport of r9971 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9973 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 07:24:30 +00:00
Malcolm Tredinnick
dce458cde2 [1.0.X] Fixed #10251 -- Fixed model inheritance when there's also an explicit pk field.
Backport of r9970 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9972 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 07:23:18 +00:00
Malcolm Tredinnick
b57d86f226 [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
2009-03-04 05:40:22 +00:00
Malcolm Tredinnick
f1c9080984 [1.0.X] Fixed #10362 -- An update() that only affects a parent model no longer crashes.
This includes a fairly large refactor of the update() query path (and
the initial portions of constructing the SQL for any query). The
previous code appears to have been only working more or less by accident
and was very fragile.

Backport of r9967 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 05:35:10 +00:00
Malcolm Tredinnick
dcb0884d68 [1.0.X] Final pieces (he says, hopefully) of r9945 changes.
Fixed "django-admin.py diffsettings" and some GeoDjango stuff.
Refs #10395.

Backport of r9960 and r9961 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9962 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-03 02:50:23 +00:00
Malcolm Tredinnick
9e6d32edde [1.0.X] Minor update to documentation for many-to-many filter() calls.
Removed a potential ambiguity when describing how multiple conditions in one
filter() call are handled.

Backport of r9958 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9959 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-03 01:44:26 +00:00
Malcolm Tredinnick
f520f440e1 [1.0.X] Fixed #10013 -- Updated French translation for 1.0 branch.
Thanks, Stéphane Raimbault and Claude Paroz.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9957 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 23:17:10 +00:00
Jarek Zgoda
8928a8c9f8 [1.0.X] Polish translations updated
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9956 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 08:53:23 +00:00
Malcolm Tredinnick
888b154e9b [1.0.X] Fixed #10392 -- Fixed an oversight from the refactoring in r9947.
Backport of r9953 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9954 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 08:26:07 +00:00
Malcolm Tredinnick
1a5588fceb [1.0.X] Small edit to the caching docs.
Turns out, super-lightning is not faster than normal lightning. :-)

Backport of r9949 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 05:47:25 +00:00
Malcolm Tredinnick
0249177836 [1.0.X] Removed a test that was accidentally merged as part of r9927.
This was testing a feature that doesn't exist in the 1.0.X branch.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9948 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 05:19:51 +00:00
Malcolm Tredinnick
32be118081 Removed some import-time dependencies on Django's settings.
Now you can import the file storage stuff and still call settings.configure()
afterwards. There is still one import-time usage of settings in
django.contrib.comments, but that's unavoidable.

Backport of r9945 and r9946 from trunk (this is needed in order to fix #8193 in
a clean fashion, which is why it's being backported).

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9947 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 04:57:03 +00:00
Malcolm Tredinnick
9576353835 [1.0.X] The database cache wasn't correctly handling expired keys. Fixed now.
The cache tests have been failing for a long time with the db backend. This
change makes them pass again, so no test changes required here.

Backport of r9942 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9943 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 03:17:30 +00:00
Jannis Leidel
ec5a3e7a8d [1.0.X] Updated German translation, fixes #10189. Thanks julianb
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 14:24:08 +00:00
Malcolm Tredinnick
ec02cf7a85 [1.0.X] Changed the way cache specifiers are parsed.
Allows us to reuse the same code in multiple places, avoiding new and
interesting bugs (the testing framework had a DIY version that was slightly
wrong, for example). Fixed #9833.

Backport of r9936 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9937 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 08:15:52 +00:00
Malcolm Tredinnick
4d2de7a307 [1.0.X] Fixed #9548 -- Correctly detect existence of empty sessions with cache backend.
Backport of r9934 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9935 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 07:33:45 +00:00
Malcolm Tredinnick
3fc72ca8a8 [1.0.X] Fixed #8737 -- Made the PostgreSQL version number detection more flexible.
Backport of r9931 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 07:20:19 +00:00
Malcolm Tredinnick
a899f7c662 [1.0.X] Fixed a misnamed test that was inadvertently hiding an earlier one.
Backport of r9929 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9932 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 07:19:55 +00:00
Malcolm Tredinnick
016f12a2c2 [1.0.X] Fixed insert/update handling when no database interaction is required.
Fixed #10205 as part of this.

Backport of r9926 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 01:59:18 +00:00
Malcolm Tredinnick
283c89e4c6 [1.0.X] Fixed #10202 -- Fixed another couple of slicing edge-cases with querysets.
Patch from Alex Gaynor and Ramiro Morales.

Backport of r9924 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9925 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-01 01:35:36 +00:00
James Bennett
9b5b2ee2f3 [1.0.X] Fixed #10377: Added clearer warning to database notes for cx_Oracle 5.0.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9923 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-28 06:05:44 +00:00