'Returns a GeoJSON representation of the geomtry field in a `geojson`
attribute on each element of the GeoQuerySet.
The `crs` and `bbox` keywords may be set to True if the users wants
the coordinate reference system and the bounding box to be included
in the GeoJSON representation of the geometry.'

def geojson(self, precision=8, crs=False, bbox=False, **kwargs):

    backend = connections[self.db].ops
    if (not backend.geojson):
        raise NotImplementedError('Only    PostGIS    1.3.4+    supports    GeoJSON    serialization.')
    if (not isinstance(precision, (int, long))):
        raise TypeError('Precision    keyword    must    be    set    with    an    integer.')
    if (backend.spatial_version >= (1, 4, 0)):
        options = 0
        if (crs and bbox):
            options = 3
        elif bbox:
            options = 1
        elif crs:
            options = 2
    else:
        options = 0
        if (crs and bbox):
            options = 3
        elif crs:
            options = 1
        elif bbox:
            options = 2
    s = {'desc': 'GeoJSON', 'procedure_args': {'precision': precision, 'options': options}, 'procedure_fmt': '%(geo_col)s,%(precision)s,%(options)s'}
    return self._spatial_attribute('geojson', s, **kwargs)
