2
0

admin.txt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ======================
  2. GeoDjango's admin site
  3. ======================
  4. .. module:: django.contrib.gis.admin
  5. :synopsis: GeoDjango's extensions to the admin site.
  6. ``GISModelAdmin``
  7. =================
  8. .. versionadded:: 4.0
  9. .. class:: GISModelAdmin
  10. .. attribute:: gis_widget
  11. The widget class to be used for
  12. :class:`~django.contrib.gis.db.models.GeometryField`. Defaults to
  13. :class:`~django.contrib.gis.forms.widgets.OSMWidget`.
  14. .. attribute:: gis_widget_kwargs
  15. The keyword arguments that would be passed to the :attr:`gis_widget`.
  16. Defaults to an empty dictionary.
  17. ``GeoModelAdmin``
  18. =================
  19. .. class:: GeoModelAdmin
  20. .. attribute:: default_lon
  21. The default center longitude.
  22. .. attribute:: default_lat
  23. The default center latitude.
  24. .. attribute:: default_zoom
  25. The default zoom level to use. Defaults to 4.
  26. .. attribute:: extra_js
  27. Sequence of URLs to any extra JavaScript to include.
  28. .. attribute:: map_template
  29. Override the template used to generate the JavaScript slippy map.
  30. Default is ``'gis/admin/openlayers.html'``.
  31. .. attribute:: map_width
  32. Width of the map, in pixels. Defaults to 600.
  33. .. attribute:: map_height
  34. Height of the map, in pixels. Defaults to 400.
  35. .. attribute:: openlayers_url
  36. Link to the URL of the OpenLayers JavaScript. Defaults to
  37. ``'https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js'``.
  38. .. attribute:: modifiable
  39. Defaults to ``True``. When set to ``False``, disables editing of
  40. existing geometry fields in the admin.
  41. .. note::
  42. This is different from adding the geometry field to
  43. :attr:`~django.contrib.admin.ModelAdmin.readonly_fields`,
  44. which will only display the WKT of the geometry. Setting
  45. ``modifiable=False``, actually displays the geometry in a map,
  46. but disables the ability to edit its vertices.
  47. .. deprecated:: 4.0
  48. This class is deprecated. Use :class:`~django.contrib.admin.ModelAdmin`
  49. instead.
  50. ``OSMGeoAdmin``
  51. ===============
  52. .. class:: OSMGeoAdmin
  53. A subclass of :class:`GeoModelAdmin` that uses a Spherical Mercator projection
  54. with `OpenStreetMap <https://www.openstreetmap.org/>`_ street data tiles.
  55. .. deprecated:: 4.0
  56. This class is deprecated. Use :class:`GISModelAdmin` instead.