'Provides a proper substitution value for Geometries that are not in the
SRID of the field.  Specifically, this routine will substitute in the
ST_Transform() function call.'

def get_geom_placeholder(self, f, value):

    if ((value is None) or (value.srid == f.srid)):
        placeholder = '%s'
    else:
        placeholder = ('%s(%%s,    %s)' % (self.transform, f.srid))
    if hasattr(value, 'expression'):
        placeholder = ((placeholder % '%s.%s') % tuple(map(self.quote_name, value.cols[value.expression])))
    return placeholder
