'Returns the selection format string, depending on the requirements
of the spatial backend.  For example, Oracle and MySQL require custom
selection formats in order to retrieve geometries in OGC WKT. For all
other fields a simple \'%s\' format string is returned.'

def get_select_format(self, fld):

    if (self.connection.ops.select and hasattr(fld, 'geom_type')):
        sel_fmt = self.connection.ops.select
        if (self.query.transformed_srid and (self.connection.ops.oracle or self.connection.ops.spatialite)):
            sel_fmt = ("'SRID=%d;'||%s" % (self.query.transformed_srid, sel_fmt))
    else:
        sel_fmt = '%s'
    return sel_fmt
