Commit Graph

470 Commits

Author SHA1 Message Date
Claude Paroz b14bd60404 Reimplemented PostGIS spatial_version with cached_property 2013-05-27 12:06:56 +02:00
Ramiro Morales 0fa8d43e74 Replaced `and...or...` constructs with PEP 308 conditional expressions. 2013-05-26 23:47:50 -03:00
Aymeric Augustin 9c487b5974 Replaced an antiquated pattern.
Thanks Lennart Regebro for pointing it out.
2013-05-17 18:08:58 +02:00
Claude Paroz b16b72d415 Fixed #5472 --Added OpenLayers-based widgets in contrib.gis
Largely inspired from django-floppyforms. Designed to not depend
on OpenLayers at code level.
2013-05-17 13:33:40 +02:00
Claude Paroz 0a29057ebe Fixed #20415 -- Ensured srid is not localized in openlayers template
Thanks pierremarc07 at gmail.com for the report.
2013-05-16 13:48:38 +02:00
Mike Fogel 3188775174 Fix bug introduced in contrib.gis in 74f3884ae0 2013-05-15 14:07:34 -07:00
Mike Fogel 74f3884ae0 Fixed #20413 - Respect Query.get_meta() 2013-05-15 12:55:30 -07:00
Florian Apolloner ebfb71c64a Fixed previous commit. (Don't commit from DjangCon!) 2013-05-15 16:50:33 +02:00
Florian Apolloner f6d1ca56c9 Don't unregister OSMGeoAdmin, other tests rely on it. 2013-05-15 16:47:03 +02:00
Florian Apolloner a6edde3260 Fixed embarrassing typo. 2013-05-11 22:57:01 +02:00
Florian Apolloner 01820466ca Don't hardcode primary keys in gis tests. 2013-05-11 22:42:39 +02:00
Florian Apolloner 2bf403ecbd Fixed a regression from e23a5f9a47.
Excluded postgis specific gis tests from other spatial databases.

Refs #17365, #17366, #18727.
2013-05-11 18:29:08 +02:00
Carl Meyer 9012833af8 Fixed #17365, #17366, #18727 -- Switched to discovery test runner.
Thanks to Preston Timmons for the bulk of the work on the patch, especially
updating Django's own test suite to comply with the requirements of the new
runner. Thanks also to Jannis Leidel and Mahdi Yusuf for earlier work on the
patch and the discovery runner.

Refs #11077, #17032, and #18670.
2013-05-10 23:08:45 -04:00
Claude Paroz 7b00d90208 [py3] Made GeoIP tests pass with Python 3 2013-05-10 13:21:07 +02:00
Claude Paroz 465a29abe0 Fixed #20384 -- Forced GeoIP_open path argument to bytestring
Thanks Julian Wachholz for the report.
2013-05-10 13:21:07 +02:00
Aymeric Augustin 1906cb9360 Fixed conditional skipping of test for left/right lookup types.
connection.ops.spatial_version is None for some backends (eg. MySQL) and
the comparison fails on Python 3 with TypeError.
2013-05-09 17:39:56 +02:00
Alex Gaynor a53d7a0a50 Made gis_terms be a set, rather than a dict with None for all keys. 2013-05-09 08:13:13 -07:00
Claude Paroz 9f7a01ef2b Updated translation templates and removed en translations
"en" translations have been mistakenly committed in 87cc3da81.
2013-05-02 16:25:23 +02:00
Claude Paroz 53df89c0fe Updated get_ogr_db_string in inspectapp tests to support MySQL/Spatialite
The OGRInspectTest.test_time_field does still not succeed with these
databases (even when removing the postgis guard), but at least it's now
possible to setup a datasource.
2013-04-15 20:27:58 +02:00
Claude Paroz 1628dfd0b9 Properly used test skipping in OGRInspectTest TestCase 2013-04-15 19:38:24 +02:00
Claude Paroz ddfc68379f Changed a deprecated warn() call in libgeos 2013-04-11 11:01:17 +02:00
Claude Paroz 244e765a94 Updated translation templates 2013-03-28 10:06:11 +01:00
Claude Paroz c5084e7557 Updated translations from Transifex
Polish, Telugu, Georgian, Azerbaijani, Norwegian Bokmål, Basque,
Dutch, Thai, Spanish (Argentina), Afrikaans.
2013-03-28 09:24:07 +01:00
konarkmodi bc4111ba68 Fixed #18003 -- Preserved tracebacks when re-raising errors.
Thanks jrothenbuhler for draft patch, Konark Modi for updates.
2013-03-19 15:42:39 -07:00
Claude Paroz 18e990fa96 Fixed #16110 -- Fixed GeometryField odd behaviour regarding null values
Thanks slinkp for the report and the initial patch.
2013-03-15 21:45:33 +01:00
Claude Paroz 747f7d2549 Fixed #20036 -- Improved GEOS version string parsing
Thanks chikiro.spam at gmail.com for the report.
2013-03-13 09:52:33 +01:00
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
Aymeric Augustin 4846e2b744 Removed unused imports.
One of these functions didn't exist anymore.
2013-03-12 10:09:04 +01:00
Aymeric Augustin f2f98abb95 Avoided closing the database connection within a transaction.
Refs #9437.
2013-03-11 21:08:49 +01:00
Aymeric Augustin 1adb7b3c38 Ported layermapping for autocommit. 2013-03-11 20:03:17 +01:00
Aymeric Augustin ba5138b1c0 Deprecated transaction.commit/rollback_unless_managed.
Since "unless managed" now means "if database-level autocommit",
committing or rolling back doesn't have any effect.

Restored transactional integrity in a few places that relied on
automatically-started transactions with a transitory API.
2013-03-11 14:48:54 +01:00
Claude Paroz 360217fc87 Fixed #19171 -- Allowed coordinate transforms with custom SRIDs
Thanks reidpr at lanl.gov for the report.
2013-03-09 17:46:20 +01:00
Claude Paroz e6f5b7eacd Fixed #9806 -- Allowed editing GeometryField with OpenLayersWidget
Thanks Paul Winkler for the initial patch.
2013-03-09 16:10:28 +01:00
Claude Paroz f3d1aebed1 Reformatted slightly openlayers.js 2013-03-09 15:08:16 +01:00
Claude Paroz 5e80571bf9 Fixed #16594 -- Added wkt 3D support for GEOS geometries
This requires GEOS >= 3.3.0 to function properly. On previous
versions, the Z dimension will simply not appear in the wkt.
Disabled OpenLayers editing for 3D geometries (unsupported).
2013-03-09 12:02:22 +01:00
Claude Paroz 8a92139d8a Replaced proj4 testing by a regex 2013-03-08 22:52:41 +01:00
Loic Bistuer 6983a1a540 Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that return a QuerySet. 2013-03-08 10:11:45 -05:00
Ramiro Morales 3bbcec0aba Removed mentions of regressiontests. 2013-03-03 17:03:11 -03:00
Claude Paroz 87cc3da814 Merged contrib translations from 1.5 branch 2013-02-26 21:51:06 +01:00
Aymeric Augustin e74e207cce Fixed #17260 -- Added time zone aware aggregation and lookups.
Thanks Carl Meyer for the review.

Squashed commit of the following:

commit 4f290bdb60
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 21:21:30 2013 +0100

    Used '0:00' instead of 'UTC' which doesn't always exist in Oracle.

    Thanks Ian Kelly for the suggestion.

commit 01b6366f3c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 13:38:43 2013 +0100

    Made tzname a parameter of datetime_extract/trunc_sql.

    This is required to work around a bug in Oracle.

commit 924a144ef8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 14:47:44 2013 +0100

    Added support for parameters in SELECT clauses.

commit b4351d2890
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 22:30:22 2013 +0100

    Documented backwards incompatibilities in the two previous commits.

commit 91ef84713c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:42:31 2013 +0100

    Used QuerySet.datetimes for the admin's date_hierarchy.

commit 0d0de288a5
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:29:38 2013 +0100

    Used QuerySet.datetimes in date-based generic views.

commit 9c0859ff7c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:25 2013 +0100

    Implemented QuerySet.datetimes on Oracle.

commit 68ab511a4f
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:14 2013 +0100

    Implemented QuerySet.datetimes on MySQL.

commit 22d52681d3
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:42:29 2013 +0100

    Implemented QuerySet.datetimes on SQLite.

commit f6800fd04c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:03 2013 +0100

    Implemented QuerySet.datetimes on PostgreSQL.

commit 0c829c23f4
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:41:08 2013 +0100

    Added datetime-handling infrastructure in the ORM layers.

commit 104d82a777
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 10:05:55 2013 +0100

    Updated null_queries tests to avoid clashing with the __second lookup.

commit c01bbb3235
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 23:07:41 2013 +0100

    Updated tests of .dates().

    Replaced .dates() by .datetimes() for DateTimeFields.
    Replaced dates with datetimes in the expected output for DateFields.

commit 50fb7a5246
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:40:09 2013 +0100

    Updated and added tests for QuerySet.datetimes.

commit a8451a5004
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 22:34:46 2013 +0100

    Documented the new time lookups and updated the date lookups.

commit 29413eab2b
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 16:15:49 2013 +0100

    Documented QuerySet.datetimes and updated QuerySet.dates.
2013-02-16 09:19:04 +01:00
Claude Paroz 87854b0bdf Fixed geos test to prevent random failure
Points in the test fixtures have 20 as max coordinate.
2013-02-15 20:13:36 +01:00
Claude Paroz 35185495e3 Fixed #17066 -- Prevented TypeError in GeoIP.__del__
When garbaging GeoIP instances, it happens that GeoIP_delete is
already None.
Thanks mitar for the report and stefanw for tests.
2013-02-15 17:12:14 +01:00
Simon Charette ec469ade2b Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`. 2013-02-05 04:16:07 -05:00
Claude Paroz a1c470a6f6 Lowered field ordering requirement in ogrinspect test
This test was randomly failing depending on the library environment.
2013-02-02 14:01:24 +01:00
Claude Paroz 8eb84081ad Set bigger maxDiff for ogrinspect tests 2013-02-01 09:34:39 +01:00
Claude Paroz eb9430fc4b Implemented some SpatiaLiteOperations as cached properties
Previously, some properties weren't set unless
confirm_spatial_components_versions() was explicitely called.
2013-01-29 19:39:11 +01:00
Tim Graham ee26797cff Fixed typos in docs and comments 2013-01-29 10:55:55 -07:00
Claude Paroz ebb504db69 Moved has_changed logic from widget to form field
Refs #16612. Thanks Aymeric Augustin for the suggestion.
2013-01-25 20:50:46 +01:00
Claude Paroz 84ea85fb90 Updated comment about PostGIS bug 2035
PostGIS 2.0.2 has been released on December 3rd 2012, with the
fix included.
2013-01-03 17:37:44 +01:00
Florian Apolloner cf7afeb2d1 Fixed a NameError in geoip/libgeoip if the GeoIP library is not found.
Thx to Bouke Haarsma for the report.
2013-01-01 12:24:02 +01:00