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

This commit is contained in:
Brendan Hayward 2015-05-08 22:52:15 +05:00 committed by Tim Graham
parent 7fa1dd8a80
commit c9fb4f3c45
8 changed files with 42 additions and 48 deletions

View file

@ -238,20 +238,14 @@ model to represent this data::
lon = models.FloatField()
lat = models.FloatField()
# GeoDjango-specific: a geometry field (MultiPolygonField), and
# overriding the default manager with a GeoManager instance.
# GeoDjango-specific: a geometry field (MultiPolygonField)
mpoly = models.MultiPolygonField()
objects = models.GeoManager()
# Returns the string representation of the model.
def __str__(self): # __unicode__ on Python 2
return self.name
Please note two important things:
1. The ``models`` module is imported from ``django.contrib.gis.db``.
2. You must override the model's default manager with
:class:`~django.contrib.gis.db.models.GeoManager` to perform spatial queries.
Note that the ``models`` module is imported from ``django.contrib.gis.db``.
The default spatial reference system for geometry fields is WGS84 (meaning
the `SRID`__ is 4326) -- in other words, the field coordinates are in
@ -579,7 +573,6 @@ directly into the ``models.py`` of a GeoDjango application::
lon = models.FloatField()
lat = models.FloatField()
geom = models.MultiPolygonField(srid=4326)
objects = models.GeoManager()
# Auto-generated `LayerMapping` dictionary for WorldBorder model
worldborders_mapping = {