Commit c9fb4f3c authored by Brendan Hayward's avatar Brendan Hayward Committed by Tim Graham
Browse files

Fixed #25205 -- Removed doc references to deprecated GeoManager class.

parent 7fa1dd8a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ answer newbie questions, and generally made Django that much better:
    Bouke Haarsma <bouke@haarsma.eu>
    Božidar Benko <bbenko@gmail.com>
    Brant Harris
    Brendan Hayward <brendanhayward85@gmail.com>
    Brenton Simpson <http://theillustratedlife.com>
    Brett Cannon <brett@python.org>
    Brett Hoerner <bretthoerner@bretthoerner.com>
+3 −4
Original line number Diff line number Diff line
@@ -226,13 +226,12 @@ in southern Texas::
        # A projected coordinate system (only valid for South Texas!)
        # is used, units are in meters.
        point = models.PointField(srid=32140)
        objects = models.GeoManager()

Then distance queries may be performed as follows::

    >>> from django.contrib.gis.geos import *
    >>> from django.contrib.gis.geos import fromstr
    >>> from django.contrib.gis.measure import D # ``D`` is a shortcut for ``Distance``
    >>> from geoapp import SouthTexasCity
    >>> from geoapp.models import SouthTexasCity
    # Distances will be calculated from this point, which does not have to be projected.
    >>> pnt = fromstr('POINT(-96.876369 29.905320)', srid=4326)
    # If numeric parameter, units of field (meters in this case) are assumed.
+2 −1
Original line number Diff line number Diff line
@@ -216,8 +216,9 @@ In the following example, the distance from the city of Hobart to every other
:class:`~django.contrib.gis.db.models.PointField` in the ``AustraliaCity``
queryset is calculated::

    >>> from django.contrib.gis.db.models.functions import Distance
    >>> pnt = AustraliaCity.objects.get(name='Hobart').point
    >>> for city in AustraliaCity.objects.distance('point', pnt):
    >>> for city in AustraliaCity.objects.annotate(distance=Distance('point', pnt)):
    ...     print(city.name, city.distance)
    Wollongong 990071.220408 m
    Shellharbour 972804.613941 m
+2 −0
Original line number Diff line number Diff line
@@ -629,6 +629,8 @@ Oracle ``SDO_WITHIN_DISTANCE(poly, geom, 5)``

    This lookup is not available on SpatiaLite.

.. _geoqueryset-methods:

``GeoQuerySet`` Methods
=======================

+0 −1
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ Example
    class TestGeo(models.Model):
        name = models.CharField(max_length=25) # corresponds to the 'str' field
        poly = models.PolygonField(srid=4269) # we want our model in a different SRID
        objects = models.GeoManager()

        def __str__(self):              # __unicode__ on Python 2
            return 'Name: %s' % self.name
Loading