PageRenderTime 3ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/ref/contrib/gis/commands.txt

https://code.google.com/p/mango-py/
Plain Text | 83 lines | 56 code | 27 blank | 0 comment | 0 complexity | d5a162c0438ae999b072e2b17dbfe20d MD5 | raw file
 1.. ref-geodjango-admin:
 2
 3=============================
 4GeoDjango Management Commands
 5=============================
 6
 7inspectdb
 8=========
 9
10.. describe:: django-admin.py inspectdb
11
12When :mod:`django.contrib.gis` is in your :setting:`INSTALLED_APPS`, the
13:djadmin:`inspectdb` management command is overridden with one from GeoDjango.
14The overridden command is spatially-aware, and places geometry fields in the
15auto-generated model definition, where appropriate.
16
17ogrinspect <data_source> <model_name>
18=====================================
19
20.. django-admin:: ogrinspect
21
22The ``ogrinpsect`` management command will inspect the given OGR-compatible
23:class:`~django.contrib.gis.gdal.DataSource` (e.g., a shapefile) and will
24output a GeoDjango model with the given model name.  There's a detailed example
25of using ``ogrinspect`` :ref:`in the tutorial <ogrinspect-intro>`.
26
27.. django-admin-option:: --blank <blank_field(s)>
28
29   Use a comma separated list of OGR field names to add the ``blank=True``
30   keyword option to the field definition.  Set with ``true`` to apply
31   to all applicable fields.
32
33.. django-admin-option:: --decimal <decimal_field(s)>
34
35   Use a comma separated list of OGR float fields to generate
36   :class:`~django.db.models.DecimalField` instead of the default
37   :class:`~django.db.models.FloatField`. Set to ``true`` to apply to all
38   OGR float fields.
39
40.. django-admin-option:: --geom-name <name>
41
42   Specifies the model attribute name to use for the geometry field.
43   Defaults to ``'geom'``.
44
45.. django-admin-option:: --layer <layer>
46
47   The key for specifying which layer in the OGR
48   :class:`~django.contrib.gis.gdal.DataSource` source to use.
49   Defaults to 0 (the first layer). May be an integer or a string identifier
50   for the :class:`~django.contrib.gis.gdal.Layer`.
51
52.. django-admin-option:: --mapping
53
54   Automatically generate a mapping dictionary for use with
55   :class:`~django.contrib.gis.utils.LayerMapping`.
56
57.. django-admin-option:: --multi-geom
58
59   When generating the geometry field, treat it as a geometry collection.
60   For example, if this setting is enabled then a
61   :class:`~django.contrib.gis.db.models.MultiPolygonField` will be placed
62   in the generated model rather than
63   :class:`~django.contrib.gis.db.models.PolygonField`.
64
65.. django-admin-option:: --name-field <name_field>
66
67   Generates a ``__unicode__`` routine on the model that will return the
68   the given field name.
69
70.. django-admin-option:: --no-imports
71
72   Suppresses the ``from django.contrib.gis.db import models`` import statement.
73
74.. django-admin-option:: --null <null_field(s)>
75
76   Use a comma separated list of OGR field names to add the ``null=True``
77   keyword option to the field definition.  Set with ``true`` to apply to
78   all applicable fields.
79
80.. django-admin-option:: --srid
81
82   The SRID to use for the geometry field.  If not set, ``ogrinspect`` attempts
83   to automatically determine of the SRID of the data source.