Commit Graph

6834 Commits

Author SHA1 Message Date
Russell Keith-Magee 638dbc3e83 Fixed #6464 -- Added incr() and decr() operations on cache backends. Atomic on Memcache; implemented as a 2 stage retrieve/update on other backends. Includes refactor of the cache tests to ensure all the backends are actually tested, and a fix to the DB cache backend that was discovered as a result. Thanks to Michael Malone for the original patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10031 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-11 13:27:03 +00:00
Russell Keith-Magee 1d8e6eae34 Fixed #10463 -- Corrected a problem with the MySQL backend, introduced by [10026].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-11 11:03:36 +00:00
Malcolm Tredinnick 5fb6667036 Fixed #3460 -- Added an ability to enable true autocommit for psycopg2 backend.
Ensure to read the documentation before blindly enabling this: requires some
code audits first, but might well be worth it for busy sites.

Thanks to nicferrier, iamseb and Richard Davies for help with this patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10029 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-11 07:06:50 +00:00
Malcolm Tredinnick 0543f33bbc Fixed the django.contrib.gis test database creation as well.
Refs r10026 and r10027.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10028 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-11 05:48:26 +00:00
Malcolm Tredinnick 6c6edb9d04 Fixed some breakages in the test database handling from r10026.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10027 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-11 04:56:13 +00:00
Adrian Holovaty 315145f7ca Fixed #10459 -- Refactored the internals of database connection objects so that connections know their own settings and pass around settings as dictionaries instead of passing around the Django settings module itself. This will make it easier for multiple database support. Thanks to Alex Gaynor for the initial patch.
This is backwards-compatible but will likely break third-party database backends. Specific API changes are:

* BaseDatabaseWrapper.__init__() now takes a settings_dict instead of a settings module. It's called settings_dict to disambiguate, and for easy grepability. This should be a dictionary containing DATABASE_NAME, etc.

* BaseDatabaseWrapper has a settings_dict attribute instead of an options attribute. BaseDatabaseWrapper.options is now BaseDatabaseWrapper['DATABASE_OPTIONS']

* BaseDatabaseWrapper._cursor() no longer takes a settings argument.

* BaseDatabaseClient.__init__() now takes a connection argument (a DatabaseWrapper instance) instead of no arguments.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@10026 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-11 03:39:34 +00:00
Ian Kelly 7daf0b9407 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/trunk@10024 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 22:48:42 +00:00
Ian Kelly a4f1e48ddb 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/trunk@10022 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 18:37:22 +00:00
Justin Bronn 6aa5aacc86 Fixed #9204 -- Added `GIcon` overlay, allowing customization for icons of `GMarker` objects. Thanks to qingfeng for initial ticket/patch, and to prairiedogg for final implementation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10021 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 18:03:35 +00:00
Malcolm Tredinnick 326c5813b9 Removed a FIXME from the queryset-refactor days.
Turns out, nothing needed to be fixed.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10018 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 11:21:46 +00:00
Russell Keith-Magee 3c8568a7dc 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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10017 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 11:19:26 +00:00
Malcolm Tredinnick d0fff8ccd4 Fixed #10439 -- Fixed a subtle test failure caused by r9994.
Thanks to Ramiro Morales for debugging what was going on here.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10015 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 05:51:06 +00:00
Malcolm Tredinnick 0516c5d921 Fixed #10443 -- Fixed model attribute updating after r10003.
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).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 05:24:19 +00:00
Malcolm Tredinnick ec9c03ce0b Added an editorial comment to a test.
This is to stop me trying to "fix" that piece of code again in the future.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-10 05:23:42 +00:00
Justin Bronn d45e24a1f8 Fixed #9955 -- Added `GoogleMapSet`, which enables multiple `GoogleMap` objects to placed on the same page; moved all templates to `google` parent dir, and added 'google-map.html' for an included example. Thanks to mandric for the ticket and aromano for initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10011 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 19:22:24 +00:00
Jannis Leidel a7ff8b79ff Updates German translation, fixes #10444
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10009 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 16:33:52 +00:00
Malcolm Tredinnick b4dd4d4bb7 Fixed #3163 -- Add a "Meta.managed" option to models.
This allows a model to be defined which is not subject to database table
creation and removal. Useful for models that sit over existing tables or
database views.

Thanks to Alexander Myodov, Wolfgang Kriesing and Ryan Kelly for the bulk of
this patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10008 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 03:35:02 +00:00
Malcolm Tredinnick 98710a5a28 Made a couple of cross-references in the model fields documentaiton consistent.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10007 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 03:33:54 +00:00
Malcolm Tredinnick 059765fa6c Fixed #9436 -- Updated docs build code to create "new in development version".
Patch from Marc Fargas.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10006 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 01:37:17 +00:00
Malcolm Tredinnick fedea84f3c Changed a few versionadded doc directives from "development" to "1.1".
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 01:36:53 +00:00
Malcolm Tredinnick 35f934f5a7 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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10003 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-09 00:03:03 +00:00
Justin Bronn cee31735f7 Fixed #10072 -- `GMarker` overlays now have `draggable` option. Thanks to prairiedogg for ticket and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10002 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 18:34:24 +00:00
Malcolm Tredinnick 392f81cba9 Fixed #9626 -- Fixed a deletion race in the locmem cache.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 09:59:43 +00:00
Malcolm Tredinnick 6e415a5f90 Fixed #9508 -- Added an appropriate FileField.__hash__ implementation.
Required because we declare a custom __eq__ method.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9997 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 09:59:17 +00:00
Malcolm Tredinnick d01c17e81d 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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9996 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 09:58:40 +00:00
Malcolm Tredinnick 242fc60520 Fixed #9323 -- Allow glob loading in INSTALLED_APPS to handle digits in names.
Patch from carljm.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9994 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 09:39:48 +00:00
Malcolm Tredinnick d8fdf4d7ac Fixed #9399 -- Added StopFutureHandlers to export list in file handling.
Thanks, George Vilches.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 09:31:30 +00:00
Karen Tracey e8a817d499 Fixed #10433: Corrected typo in test doc. Thanks Matt Doran.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 04:31:05 +00:00
Malcolm Tredinnick cd99c62e2d Fixed #10432 -- Handle all kinds of iterators in queryset filters.
Only consumes the iterators once and works with Python 2.3.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9986 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-08 03:32:16 +00:00
Justin Bronn f1ada99997 Maintenance refactor of the GDAL (OGR) ctypes interface. Changes include:
* All C API method explictly called from their prototype module, no longer imported via *.
* Applied DRY to C pointer management, classes that do so subclass from `GDALBase`.
* `OGRGeometry`: Added `from_bbox` class method (patch from Christopher Schmidt) and `kml` property.
* `SpatialReference`: Now initialize with `SetFromUserInput` (initialization is now more simple and flexible); removed duplicate methods.
* `Envelope`: Added `expand_to_include` method and now allow same coordinates for lower left and upper right points.  Thanks to Paul Smith for tickets and patches.
* `OGRGeomType`: Now treat OGC 'Geometry' type as 'Unknown'.

Fixed #9855, #10368, #10380.  Refs #9806.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-07 23:02:48 +00:00
Malcolm Tredinnick 53da1e4794 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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9983 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-06 04:51:05 +00:00
Malcolm Tredinnick b5d4a8ae1b Fixed #6710 -- Made DATABASE_OPTIONS work with postgresql_psycopg2 backend.
Thanks to rcoup for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-06 02:36:56 +00:00
Malcolm Tredinnick 923f78f504 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 #9868.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9979 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-06 02:02:09 +00:00
Justin Bronn 68f81c873d Fixed #10397 -- made GIS test runner compatible with changes in r9756.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9978 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-06 02:01:20 +00:00
Ian Kelly ad6ce1e6f9 Clarified documentation regarding Oracle's treatment of nulls and empty strings.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-05 20:21:22 +00:00
Malcolm Tredinnick 7197a4dcb7 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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9974 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 10:39:29 +00:00
Malcolm Tredinnick f9c8eeb311 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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 07:21:14 +00:00
Malcolm Tredinnick dfd7a6c781 Fixed #10251 -- Fixed model inheritance when there's also an explicit pk field.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9970 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 07:20:08 +00:00
Malcolm Tredinnick 0e93f60c7f 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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 05:34:01 +00:00
Malcolm Tredinnick 14c8e5227a 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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9966 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 05:33:23 +00:00
Malcolm Tredinnick c7a1a9f380 Changed the handling of as_sql() versus _as_sql() in Query/QuerySet from r9928.
This avoids inadvertently hiding AttributeError that is raised for other
reasons.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9965 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 04:56:20 +00:00
Malcolm Tredinnick f5063914b3 Fixed #10381 -- Fixed some a machine-dependent test failure after r9921.
The patch is from Russell, but I'm applying it because I want my tests to pass
again (and he doesn't see the failure).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9964 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-04 04:53:15 +00:00
Justin Bronn 9b8c712ca7 Fixed #10159 -- `F()` expressions now work on geographic fields. The tests are in `relatedapp`, which has been retrofitted to work with Oracle (minus the prior offending tests). I'm back.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9963 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-03 22:10:15 +00:00
Malcolm Tredinnick 7b55da0501 Final piece (he says, hopefully) of r9945 changes.
This time, "django-admin.py diffsettings" is fixed.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9961 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-03 02:48:02 +00:00
Malcolm Tredinnick fdca9e55e8 Fixed #10395 -- Fixed more fallout from r9945.
(Simultaneously, stop django.contrib.gis using some internal attribute when
there's a perfectly good public property available to do the same thing.)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9960 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-03 02:45:15 +00:00
Malcolm Tredinnick 5e8ddd59e2 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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9958 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-03 01:40:47 +00:00
Jarek Zgoda d79655bdc9 Updated Czech localflavor in Polish translation
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9955 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 08:49:47 +00:00
Malcolm Tredinnick 00d89f80a5 Fixed #10392 -- Fixed an oversight from the refactoring in r9945.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9953 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 08:24:14 +00:00
Malcolm Tredinnick dfddf129f0 Fixed #9701 -- Added a "safeseq" template filter.
This is like "safe", except it operates on the individual elements of a
sequence, rather than treating the whole argument as a string.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 08:16:33 +00:00
Malcolm Tredinnick 851461aa72 Fixed #10181 -- Handle an EmptyResultSet exception case properly in nested querysets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9951 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 06:08:02 +00:00