File: admin.txt

package info (click to toggle)
python-django 3%3A3.2.19-1%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 56,696 kB
  • sloc: python: 264,418; javascript: 18,362; xml: 193; makefile: 178; sh: 43
file content (68 lines) | stat: -rw-r--r-- 1,833 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
======================
GeoDjango's admin site
======================

.. module:: django.contrib.gis.admin
    :synopsis: GeoDjango's extensions to the admin site.

``GeoModelAdmin``
=================

.. class:: GeoModelAdmin

    .. attribute:: default_lon

    The default center longitude.

    .. attribute:: default_lat

    The default center latitude.

    .. attribute:: default_zoom

    The default zoom level to use.  Defaults to 4.

    .. attribute:: extra_js

    Sequence of URLs to any extra JavaScript to include.

    .. attribute:: map_template

    Override the template used to generate the JavaScript slippy map.
    Default is ``'gis/admin/openlayers.html'``.

    .. attribute:: map_width

    Width of the map, in pixels.  Defaults to 600.

    .. attribute:: map_height

    Height of the map, in pixels.  Defaults to 400.

    .. attribute:: openlayers_url

    Link to the URL of the OpenLayers JavaScript.  Defaults to
    ``'https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/OpenLayers.js'``.

    .. attribute:: modifiable

    Defaults to ``True``.  When set to ``False``, disables editing of
    existing geometry fields in the admin.

    .. note::

        This is different from adding the geometry field to
        :attr:`~django.contrib.admin.ModelAdmin.readonly_fields`,
        which will only display the WKT of the geometry. Setting
        ``modifiable=False``, actually displays the geometry in a map,
        but disables the ability to edit its vertices.

``OSMGeoAdmin``
===============

.. class:: OSMGeoAdmin

    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.