django1/django/contrib/gis
Anssi Kääriäinen d3f00bd570 Refactored qs.add_q() and utils/tree.py
The sql/query.py add_q method did a lot of where/having tree hacking to
get complex queries to work correctly. The logic was refactored so that
it should be simpler to understand. The new logic should also produce
leaner WHERE conditions.

The changes cascade somewhat, as some other parts of Django (like
add_filter() and WhereNode) expect boolean trees in certain format or
they fail to work. So to fix the add_q() one must fix utils/tree.py,
some things in add_filter(), WhereNode and so on.

This commit also fixed add_filter to see negate clauses up the path.
A query like .exclude(Q(reversefk__in=a_list)) didn't work similarly to
.filter(~Q(reversefk__in=a_list)). The reason for this is that only
the immediate parent negate clauses were seen by add_filter, and thus a
tree like AND: (NOT AND: (AND: condition)) will not be handled
correctly, as there is one intermediary AND node in the tree. The
example tree is generated by .exclude(~Q(reversefk__in=a_list)).

Still, aggregation lost connectors in OR cases, and F() objects and
aggregates in same filter clause caused GROUP BY problems on some
databases.

Fixed #17600, fixed #13198, fixed #17025, fixed #17000, fixed #11293.
2013-03-13 10:44:49 +02:00
..
admin Fixed #9806 -- Allowed editing GeometryField with OpenLayersWidget 2013-03-09 16:10:28 +01:00
db Refactored qs.add_q() and utils/tree.py 2013-03-13 10:44:49 +02:00
forms Moved has_changed logic from widget to form field 2013-01-25 20:50:46 +01:00
gdal Fixed typos in docs and comments 2013-01-29 10:55:55 -07:00
geoip Fixed #17066 -- Prevented TypeError in GeoIP.__del__ 2013-02-15 17:12:14 +01:00
geometry Fixed #19357 -- Allow non-ASCII chars in filesystem paths 2012-12-08 11:13:52 +01:00
geos Fixed #19171 -- Allowed coordinate transforms with custom SRIDs 2013-03-09 17:46:20 +01:00
locale Merged contrib translations from 1.5 branch 2013-02-26 21:51:06 +01:00
management Fixed #18013 -- Use the new 'as' syntax for exceptions. 2012-04-29 20:57:15 +02:00
maps [py3] Refactored __unicode__ to __str__. 2012-08-12 14:44:40 +02:00
sitemaps Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`. 2013-02-05 04:16:07 -05:00
templates/gis Fixed #9806 -- Allowed editing GeometryField with OpenLayersWidget 2013-03-09 16:10:28 +01:00
tests Fixed #16594 -- Added wkt 3D support for GEOS geometries 2013-03-09 12:02:22 +01:00
utils Ported layermapping for autocommit. 2013-03-11 20:03:17 +01:00
__init__.py [py3] Added buffer/memoryview compatibility 2012-09-23 19:55:53 +02:00
feeds.py Fixed #18269 -- Applied unicode_literals for Python 3 compatibility. 2012-06-07 18:08:47 +02:00
measure.py Fixed #18963 -- Used a subclass-friendly pattern 2012-11-03 22:07:35 +01:00
models.py Fixed #13315, #13430 -- Recreated `django.contrib.gis.db.backend` module with `SpatialBackend` alias and added `Adaptor` alias for backwards-compatibility purposes; added GeoDjango 1.2 backwards-incompatibility documentation and release notes; added a section in the docs about how MySQL is a crippled spatial database; updated versions in install docs. 2010-05-04 21:43:40 +00:00
shortcuts.py Replaced cStringIO.StringIO by io.BytesIO. 2012-05-05 21:41:44 +02:00
views.py Fixed #18269 -- Applied unicode_literals for Python 3 compatibility. 2012-06-07 18:08:47 +02:00