summaryrefslogtreecommitdiff
path: root/django/contrib/gis/db/models
AgeCommit message (Collapse)Author
2026-03-12Fixed #36727 -- Deprecated Field.get_placeholder in favor of ↵Simon Charette
get_placeholder_sql. The lack of ability of the get_placeholder call chain to return SQL and parameters separated so they can be mogrified by the backend at execution time forced implementations to dangerously interpolate potentially user controlled values. The get_placeholder_sql name was chosen due to its proximity to the previous method, but other options such as Field.as_sql were considered but ultimately rejected due to its different input signature compared to Expression.as_sql that might have lead to confusion. There is a lot of overlap between what Field.get_db_prep_value and get_placeholder_sql do but folding the latter in the former would require changing its return signature to return expression which is a way more invasive change than what is proposed here. Given we always call get_db_prep_value it might still be an avenue worth exploring in the future to offer a publicly documented interface to allow field to take an active part in the compilation chain. Thanks Jacob for the review.
2025-11-25Fixed #35783 -- Added NumDimensions GIS database function and ↵David Smith
__num_dimensions lookup.
2025-10-29Refs #35972 -- Returned params in a tuple in further lookups.Jacob Walls
2025-09-22Refs #33783 -- Added IsEmpty GIS database function and __isempty lookup on ↵David Smith
SpatiaLite.
2025-08-04Fixed #35972 -- Fixed lookup crashes after subquery annotations.Jacob Walls
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-07-23Removed double spaces after periods and within phrases.Sarah Boyce
2025-07-20Fixed #28696 -- Added GeometryType GIS database function and __geom_type lookup.Ahmed Ibrahim
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2025-03-31Refs #28909 -- Simplified code using unpacking generalizations.Aarni Koskela
2025-03-30Fixed warnings per flake8 7.2.0.Mariusz Felisiak
https://github.com/PyCQA/flake8/releases/tag/7.2.0
2025-03-03Fixed #35444 -- Added generic support for Aggregate.order_by.Chris Muthig
This moves the behaviors of `order_by` used in Postgres aggregates into the `Aggregate` class. This allows for creating aggregate functions that support this behavior across all database engines. This is shown by moving the `StringAgg` class into the shared `aggregates` module and adding support for all databases. The Postgres `StringAgg` class is now a thin wrapper on the new shared `StringAgg` class. Thank you Simon Charette for the review.
2025-02-23Fixed #35705 -- Added Rotate GIS database function to rotate geometries.enprava
2024-04-26Refs #35339 -- Fixed source expressions in GeoAggregate on Oracle.Mariusz Felisiak
Regression in 42b567ab4c5bfb1bbd3e629b1079271c5ae44ea0.
2024-03-18Refs #31014 -- Added srid argument to FromWKB/FromWKT() GIS functions.Claude Paroz
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2024-01-05Fixed #35086 -- Added support for BoundedCircle on Spatialite 5.1+.David Smith
Spatialite 5.1 added support for BoundingCircle (GEOSMinimumBoundingCircle). GEOS 3.7 is required which is lower than Django's currently supported minmum of 3.8. https://groups.google.com/g/spatialite-users/c/hAJ2SgitN4M https://www.gaia-gis.it/gaia-sins/spatialite-sql-5.1.0.html
2023-10-06Fixed #34882 -- Fixed no options in AsGeoJSON() for geometries in ↵Denis Rouzaud
non-default CRS.
2023-08-02Removed unneeded escapes in regexes.Mariusz Felisiak
Special characters lose their special meaning inside sets of characters. "-" lose its special meaning if it's placed as the first or last character. Follow up to 7c6b66383da5f9a67142334cd2ed2d769739e8f1.
2023-06-16Fixed #34629 -- Added filtering support to GIS aggregates.Olivier Le Thanh Duong
2023-06-16Refs #34629 -- Changed SDOAGGRTYPE wrapping to Func() in GIS aggregates on ↵Mariusz Felisiak
Oracle.
2023-01-20Fixed #34266 -- Added ClosestPoint GIS database functions.Niccolò Mineo
2023-01-10Refs #31014 -- Added FromWKB and FromWKT GIS database functions.Mariusz Felisiak
Co-authored-by: Ondřej Böhm <ondrej.bohm@firma.seznam.cz> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2023-01-03Fixed #33783 -- Added IsEmpty GIS database function and __isempty lookup on ↵Claude Paroz
PostGIS.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-08-02Refs #32956 -- Corrected usage of "insure" and "assure".David Smith
2020-11-09Renamed BaseSpatialOperations.geography to ↵Tim Graham
BaseSpatialFeatures.supports_geography.
2020-07-15Fixed #30446 -- Resolved Value.output_field for stdlib types.Simon Charette
This required implementing a limited form of dynamic dispatch to combine expressions with numerical output. Refs #26355 should eventually provide a better interface for that.
2020-07-14Refs #30446 -- Defined output_field of BoundingCircle() GIS database function.Simon Charette
This prevented the default behavior of BaseExpression._resolve_output_field from error'ing out when such functions accepted both expressions from mixed types (e.g. BoundingCircle(Polygon, num_seg=12)).
2020-04-14Fixed #31196 -- Added support for PostGIS 3.Sergey Fedoseev
2020-03-04Fixed CVE-2020-9402 -- Properly escaped tolerance parameter in GIS functions ↵Mariusz Felisiak
and aggregates on Oracle. Thanks to Norbert Szetei for the report.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-01-20Fixed #31142 -- Fixed MakeValid.output_field when geometry type is changed.Sergey Fedoseev
Regression in 2ef4b4795e29be8c33a6de9cc0c05b59025d13a5.
2019-11-25Fixed #31002 -- Fixed GIS lookups crash against a subquery annotation.Simon Charette
Thanks Vasileios Bouzas for the report.
2019-11-22Fixed #30996 -- Added AsWKB and AsWKT GIS functions.Sergey Fedoseev
2019-11-18Fixed #30994 -- Added Oracle support for AsGeoJSON GIS function.Sergey Fedoseev
2019-10-29Fixed #30899 -- Lazily compiled import time regular expressions.Hasan Ramezani
2019-08-23Fixed #29955 -- Added support for distance expression to the dwithin lookup.Simon Charette
This was missed when adding support to other distance lookups in refs #25499. Thanks Peter Bex for the report and Mariusz for testcases.
2019-08-13Refs #25367 -- Moved select_format hook to BaseExpression.Simon Charette
This will expose an intermediary hook for expressions that need special formatting when used in a SELECT clause.
2019-07-25Refs #30657 -- Made DeferredAttribute.__init__() to take a field instance ↵Jon Dufresne
instead of a field name.
2019-06-28Fixed #30400 -- Improved typography of user facing strings.Jon Dufresne
Thanks Claude Paroz for assistance with translations.
2019-03-20Fixed #28738 -- Added the GeometryDistance function.Francisco Couzo
2019-01-17Refs #28841 -- Removed ForceRHR function per deprecation timeline.Tim Graham
2018-12-21Fixed #29792 -- Made GeometryField.deconstruct() handle 'extent' and ↵jtiai
'tolerance' args.
2018-08-23Fixed #29048 -- Added **extra_context to database function as_vendor() methods.priyanshsaxena
2018-01-02Removed DeferredAttribute.__init__()'s unused model argument.Mariusz Felisiak
Unused since a8a81aae20a81e012fddc24f3ede556501af64a2.
2017-12-28Removed unnecessary trailing commas and spaces in various code.Mariusz Felisiak
2017-12-27Fixed #28841 -- Added ForcePolygonCW GIS function and deprecated ForceRHR.Sergey Fedoseev
2017-12-12Fixed #28896 -- Reallowed filtering a queryset with GeometryField=None.Sergey Fedoseev
Regression in 58da81a5a372a69f0bac801c412b57f3cce5f188.
2017-12-11Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.Nick Pope