Adust the as_table tag to render a pick link if appropriate
The templates are adjusted to pass on a 'reference' value, which
is the url_name of the view from which the entity should be picked.
The as_table (and related) function(s) construct and then pass on
this argument and enable takes_contex so that we have access to the
context of the enclosing template.
We only extract ReferenceProperties that end with '_link_id' since
that is how all RP's are currently named. It is not possible to
create a field with the same name as the RP, as GAE will try to
interpret it's contents as the key of an entity before even calling
any function we can override.
Patch by: Sverre Rabbelier
"""
This module holds the base `SpatialBackend` object, which is
instantiated by each spatial backend with the features it has.
"""
# TODO: Create a `Geometry` protocol and allow user to use
# different Geometry objects -- for now we just use GEOSGeometry.
from django.contrib.gis.geos import GEOSGeometry, GEOSException
class BaseSpatialBackend(object):
Geometry = GEOSGeometry
GeometryException = GEOSException
def __init__(self, **kwargs):
kwargs.setdefault('distance_functions', {})
kwargs.setdefault('limited_where', {})
for k, v in kwargs.iteritems(): setattr(self, k, v)
def __getattr__(self, name):
"""
All attributes of the spatial backend return False by default.
"""
try:
return self.__dict__[name]
except KeyError:
return False