summaryrefslogtreecommitdiff
path: root/django/contrib/gis/db/models/fields.py
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-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-03-30Fixed warnings per flake8 7.2.0.Mariusz Felisiak
https://github.com/PyCQA/flake8/releases/tag/7.2.0
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2020-11-09Renamed BaseSpatialOperations.geography to ↵Tim Graham
BaseSpatialFeatures.supports_geography.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
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-06-28Fixed #30400 -- Improved typography of user facing strings.Jon Dufresne
Thanks Claude Paroz for assistance with translations.
2018-12-21Fixed #29792 -- Made GeometryField.deconstruct() handle 'extent' and ↵jtiai
'tolerance' args.
2017-12-28Removed unnecessary trailing commas and spaces in various code.Mariusz Felisiak
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
2017-11-14Fixed #28795 -- Removed 'not in' checks and used dict.setdefault().Дилян Палаузов
2017-11-07Refs #28518 -- Improved performance of assigning values to GeometryFields.Sergey Fedoseev
2017-11-04Simplified GeometryField.select_format().Sergey Fedoseev
2017-09-12Removed django.contrib.gis.geometry.backend.Tim Graham
The layer of indirection is unchanged and undocumented since its introduction in ff60c5f9de3e8690d1e86f3e9e3f7248a15397c8.
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-09-05Refs #28518 -- Improved performance of loading geometries from DB.Sergey Fedoseev
2017-08-24Fixed #28518 -- Improved performance of loading geometries from DB.Sergey Fedoseev
2017-07-20Fixed #28370 -- Deprecated the context arg of Field.from_db_value() and ↵Tim Graham
Expression.convert_value(). Unused since a0d166306fbdc41f49e6fadf4ec84b17eb147daa.
2017-07-20Added BaseSpatialField.get_db_prep_value() to simplify.Sergey Fedoseev
BaseSpatialField.get_db_prep_value() supersedes BaseSpatialField.get_db_prep_save() and Geometry.get_db_prep_value().
2017-07-20Refs #25588 -- Removed obsolete bits of RasterField support.Tim Graham
Unused since bbfad84dd980a97174c3b061a3d1b5f1373c380d.
2017-07-20Simplified handling of GIS lookup params.Sergey Fedoseev
2017-07-20Removed unneeded check in GeometryField.from_db_value().Sergey Fedoseev
Unneeded since 6f43b2b8a55d72d1e8e04163ff0c2091cf6b8ce5.
2017-07-12Removed GeometryField.get_distance(); a GeoQuerySet leftover.Tim Graham
Follow up to a0d166306fbdc41f49e6fadf4ec84b17eb147daa.
2017-06-28Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen
2017-04-07Fixed #27972 -- Made BaseSpatialField.geodetic() use ↵Sergey Fedoseev
SpatialReference.geographic.
2017-04-07Made get_srid_info() cache use a namedtuple.Sergey Fedoseev
2017-04-07Removed connection agnostic SRID info cache from BaseSpatialField.Sergey Fedoseev
2017-03-27Refs #27736 -- Used decorators for GIS lookup registration.Sergey Fedoseev
2017-03-21Removed more GeoQuerySet leftovers.Sergey Fedoseev
Follow up to a0d166306fbdc41f49e6fadf4ec84b17eb147daa.
2017-02-07Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz
Thanks Tim Graham for the review.
2017-02-04Refs #27656 -- Updated django.contrib docstring verb style according to PEP 257.Anton Samarchyan
2017-02-01Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.Vytis Banaitis
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-17Removed GeoManager and GeoQuerySet per deprecation timeline.Tim Graham
2016-12-15Refs #27576 -- Fixed running Django's tests if GDAL isn't installed.Tim Graham
2016-12-15Fixed #27576 -- Made get_srid_info() fallback to GDAL if SpatialRefSys is ↵Sergey Fedoseev
unavailable.
2016-12-07Fixed #25708 -- Fixed annotations with geometry values.Sergey Fedoseev
2016-12-06Fixed #26789 -- Fixed handling of empty geometries in ↵Sergey Fedoseev
BaseSpatialField.get_db_prep_save().
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2016-06-21Fixed #26785 -- Made Oracle return None rather than empty string for empty ↵Sergey Fedoseev
geometries.
2016-06-18Fixed #26753 -- Made GDAL a required dependency for contrib.gisClaude Paroz
Thanks Tim Graham for the review.
2016-05-27Refs #25588 -- Fixed GDAL dependency in spatial lookups.Daniel Wiesmann
2016-05-06Fixed #25588 -- Added spatial lookups to RasterField.Daniel Wiesmann
Thanks Tim Graham for the review.
2016-05-04Fixed #22936 -- Obsoleted Field.get_prep_lookup()/get_db_prep_lookup()Claude Paroz
Thanks Tim Graham for completing the initial patch.
2016-05-02Refs 2bd1bbc -- Made GeometryField.get_db_prep_lookup() a private ↵Tim Graham
(deprecated) method.