summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorGiannis Adamopoulos <gadamopoulos@outlook.com>2020-12-09 19:12:56 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-09-17 08:56:16 +0200
commit4555aa0a489cb9dcf764edf12339097cdfa5ff84 (patch)
tree45862fd927ecc343590ed0827af911dd9002c266 /docs/ref
parentb5bf026813ca9aff83243f901edd722e0d60c2ea (diff)
Fixed #27674 -- Deprecated GeoModelAdmin and OSMGeoAdmin.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/gis/admin.txt29
-rw-r--r--docs/ref/contrib/gis/tutorial.txt34
2 files changed, 43 insertions, 20 deletions
diff --git a/docs/ref/contrib/gis/admin.txt b/docs/ref/contrib/gis/admin.txt
index 6d7e8b77df..ee66e3f2c1 100644
--- a/docs/ref/contrib/gis/admin.txt
+++ b/docs/ref/contrib/gis/admin.txt
@@ -5,6 +5,24 @@ GeoDjango's admin site
.. module:: django.contrib.gis.admin
:synopsis: GeoDjango's extensions to the admin site.
+``GISModelAdmin``
+=================
+
+.. versionadded:: 4.0
+
+.. class:: GISModelAdmin
+
+ .. attribute:: gis_widget
+
+ The widget class to be used for
+ :class:`~django.contrib.gis.db.models.GeometryField`. Defaults to
+ :class:`~django.contrib.gis.forms.widgets.OSMWidget`.
+
+ .. attribute:: gis_widget_kwargs
+
+ The keyword arguments that would be passed to the :attr:`gis_widget`.
+ Defaults to an empty dictionary.
+
``GeoModelAdmin``
=================
@@ -57,6 +75,11 @@ GeoDjango's admin site
``modifiable=False``, actually displays the geometry in a map,
but disables the ability to edit its vertices.
+ .. deprecated:: 4.0
+
+ This class is deprecated. Use :class:`~django.contrib.admin.ModelAdmin`
+ instead.
+
``OSMGeoAdmin``
===============
@@ -64,5 +87,7 @@ GeoDjango's admin site
A subclass of :class:`GeoModelAdmin` that uses a Spherical Mercator projection
with `OpenStreetMap <https://www.openstreetmap.org/>`_ street data tiles.
- See the :ref:`OSMGeoAdmin introduction <osmgeoadmin-intro>`
- in the tutorial for a usage example.
+
+ .. deprecated:: 4.0
+
+ This class is deprecated. Use :class:`GISModelAdmin` instead.
diff --git a/docs/ref/contrib/gis/tutorial.txt b/docs/ref/contrib/gis/tutorial.txt
index 0bdd09e163..1b8f54495a 100644
--- a/docs/ref/contrib/gis/tutorial.txt
+++ b/docs/ref/contrib/gis/tutorial.txt
@@ -697,26 +697,26 @@ Putting your data on the map
Geographic Admin
----------------
-GeoDjango extends :doc:`Django's admin application </ref/contrib/admin/index>`
-with support for editing geometry fields.
+:doc:`Django's admin application </ref/contrib/admin/index>` supports editing
+geometry fields.
Basics
~~~~~~
-GeoDjango also supplements the Django admin by allowing users to create
-and modify geometries on a JavaScript slippy map (powered by `OpenLayers`_).
+The Django admin allows users to create and modify geometries on a JavaScript
+slippy map (powered by `OpenLayers`_).
-Let's dive right in. Create a file called ``admin.py`` inside the
-``world`` application with the following code::
+Let's dive right in. Create a file called ``admin.py`` inside the ``world``
+application with the following code::
from django.contrib.gis import admin
from .models import WorldBorder
- admin.site.register(WorldBorder, admin.GeoModelAdmin)
+ admin.site.register(WorldBorder, admin.ModelAdmin)
Next, edit your ``urls.py`` in the ``geodjango`` application folder as follows::
- from django.contrib.gis import admin
+ from django.contrib import admin
from django.urls import include, path
urlpatterns = [
@@ -745,24 +745,22 @@ position.
.. _Vector Map Level 0: http://web.archive.org/web/20201024202709/https://earth-info.nga.mil/publications/vmap0.html
.. _OSGeo: https://www.osgeo.org/
-.. _osmgeoadmin-intro:
-
-``OSMGeoAdmin``
-~~~~~~~~~~~~~~~
+``GISModelAdmin``
+~~~~~~~~~~~~~~~~~
-With the :class:`~django.contrib.gis.admin.OSMGeoAdmin`, GeoDjango uses
-an `OpenStreetMap`_ layer in the admin.
+With the :class:`~django.contrib.gis.admin.GISModelAdmin`, GeoDjango uses an
+`OpenStreetMap`_ layer in the admin.
This provides more context (including street and thoroughfare details) than
-available with the :class:`~django.contrib.gis.admin.GeoModelAdmin`
-(which uses the `Vector Map Level 0`_ WMS dataset hosted at `OSGeo`_).
+available with the :class:`~django.contrib.admin.ModelAdmin` (which uses the
+`Vector Map Level 0`_ WMS dataset hosted at `OSGeo`_).
The PROJ datum shifting files must be installed (see the :ref:`PROJ
installation instructions <proj4>` for more details).
-If you meet this requirement, then substitute the ``OSMGeoAdmin`` option class
+If you meet this requirement, then use the ``GISModelAdmin`` option class
in your ``admin.py`` file::
- admin.site.register(WorldBorder, admin.OSMGeoAdmin)
+ admin.site.register(WorldBorder, admin.GISModelAdmin)
.. rubric:: Footnotes