Skip to content

Commit

Permalink
Improved "id_field" documentation in README #82
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Oct 29, 2015
1 parent 61ede3c commit fbaf9b1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,11 @@ Specifying the ID: "id_field"
#############################

The primary key of the model (usually the "id" attribute) is
automatically put outside the "properties" object (before "type") unless
``id_field`` is set to False:
automatically used as the ``id`` field of each
`GeoJSON Feature Object <https://tools.ietf.org/html/draft-butler-geojson#section-2.2>`_.

The default behaviour follows the `GeoJSON RFC <https://tools.ietf.org/html/draft-butler-geojson>`_,
but it can be disbaled by setting ``id_field`` to ``False``:

.. code-block:: python
Expand All @@ -264,8 +267,7 @@ automatically put outside the "properties" object (before "type") unless
id_field = False
fields = ('id', 'address', 'city', 'state')
You could also set the ``id_field`` to some other unique field in
your model, like **"slug"**:
The ``id_field`` can also be set to use some other unique field in your model, eg: ``slug``:

.. code-block:: python
Expand Down Expand Up @@ -300,7 +302,7 @@ read access for a REST client and can be achieved using ``auto_bbox``. Example:
The second approach uses the ``bbox_geo_field`` to specify an addional
GeometryField of the model which will be used to calculate the bounding box. This allows
``GeometryField`` of the model which will be used to calculate the bounding box. This allows
boundingboxes differ from the exact extent of a features geometry. Additionally this
enables read and write access for the REST client. Bounding boxes send from the client will
be saved as Polygons. Example:
Expand Down

0 comments on commit fbaf9b1

Please sign in to comment.