Commit f61256da authored by Josh Smeaton's avatar Josh Smeaton Committed by Simon Charette
Browse files

Renamed qn to compiler

parent 05e0e467
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ class BaseSpatialOperations(object):
        """
        raise NotImplementedError('Distance operations not available on this spatial backend.')

    def get_geom_placeholder(self, f, value, qn):
    def get_geom_placeholder(self, f, value, compiler):
        """
        Returns the placeholder for the given geometry field with the given
        value.  Depending on the spatial backend, the placeholder may contain a
+2 −2
Original line number Diff line number Diff line
@@ -35,14 +35,14 @@ class MySQLOperations(DatabaseOperations, BaseSpatialOperations):
    def geo_db_type(self, f):
        return f.geom_type

    def get_geom_placeholder(self, f, value, qn):
    def get_geom_placeholder(self, f, value, compiler):
        """
        The placeholder here has to include MySQL's WKT constructor.  Because
        MySQL does not support spatial transformations, there is no need to
        modify the placeholder based on the contents of the given value.
        """
        if hasattr(value, 'as_sql'):
            placeholder, _ = qn.compile(value)
            placeholder, _ = compiler.compile(value)
        else:
            placeholder = '%s(%%s)' % self.from_text
        return placeholder
+2 −2
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):

        return [dist_param]

    def get_geom_placeholder(self, f, value, qn):
    def get_geom_placeholder(self, f, value, compiler):
        """
        Provides a proper substitution value for Geometries that are not in the
        SRID of the field.  Specifically, this routine will substitute in the
@@ -205,7 +205,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
                placeholder = '%s'
            # No geometry value used for F expression, substitute in
            # the column name instead.
            sql, _ = qn.compile(value)
            sql, _ = compiler.compile(value)
            return placeholder % sql
        else:
            if transform_value(value, f.srid):
+2 −2
Original line number Diff line number Diff line
@@ -284,7 +284,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
        else:
            return [dist_param]

    def get_geom_placeholder(self, f, value, qn):
    def get_geom_placeholder(self, f, value, compiler):
        """
        Provides a proper substitution value for Geometries that are not in the
        SRID of the field.  Specifically, this routine will substitute in the
@@ -300,7 +300,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
            # If this is an F expression, then we don't really want
            # a placeholder and instead substitute in the column
            # of the expression.
            sql, _ = qn.compile(value)
            sql, _ = compiler.compile(value)
            placeholder = placeholder % sql

        return placeholder
+2 −2
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
            dist_param = value
        return [dist_param]

    def get_geom_placeholder(self, f, value, qn):
    def get_geom_placeholder(self, f, value, compiler):
        """
        Provides a proper substitution value for Geometries that are not in the
        SRID of the field.  Specifically, this routine will substitute in the
@@ -193,7 +193,7 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
                placeholder = '%s'
            # No geometry value used for F expression, substitute in
            # the column name instead.
            sql, _ = qn.compile(value)
            sql, _ = compiler.compile(value)
            return placeholder % sql
        else:
            if transform_value(value, f.srid):
Loading