Commit fef3f50e authored by Ville Skyttä's avatar Ville Skyttä Committed by Tim Graham
Browse files

[1.9.x] Normalized "an SQL" spelling.

Backport of 575a9a79 from master
parent 3c6b9f0b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ class BaseDatabaseOperations(object):

    def prepare_sql_script(self, sql):
        """
        Takes a SQL script that may contain multiple lines and returns a list
        Takes an SQL script that may contain multiple lines and returns a list
        of statements to feed to successive cursor.execute() calls.

        Since few databases are able to process raw SQL scripts in a single
@@ -374,7 +374,7 @@ class BaseDatabaseOperations(object):
        to tables with foreign keys pointing the tables being truncated.
        PostgreSQL requires a cascade even if these tables are empty.
        """
        raise NotImplementedError('subclasses of BaseDatabaseOperations must provide a sql_flush() method')
        raise NotImplementedError('subclasses of BaseDatabaseOperations must provide an sql_flush() method')

    def sequence_reset_by_name_sql(self, style, sequences):
        """
+1 −1
Original line number Diff line number Diff line
@@ -477,7 +477,7 @@ class F(Combinable):

class Func(Expression):
    """
    A SQL function call.
    An SQL function call.
    """
    function = None
    template = '%(function)s(%(expressions)s)'
+2 −2
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ class ForwardManyToOneDescriptor(object):
            for lh_field, rh_field in self.field.related_fields:
                setattr(instance, lh_field.attname, getattr(value, rh_field.attname))

        # Set the related instance cache used by __get__ to avoid a SQL query
        # Set the related instance cache used by __get__ to avoid an SQL query
        # when accessing the attribute we just set.
        setattr(instance, self.cache_name, value)

@@ -416,7 +416,7 @@ class ReverseOneToOneDescriptor(object):
            for index, field in enumerate(self.related.field.local_related_fields):
                setattr(value, field.attname, related_pk[index])

            # Set the related instance cache used by __get__ to avoid a SQL query
            # Set the related instance cache used by __get__ to avoid an SQL query
            # when accessing the attribute we just set.
            setattr(instance, self.cache_name, value)

+2 −2
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ We then need to define the ``as_sql`` method. This takes a ``SQLCompiler``
object, called ``compiler``,  and the active database connection.
``SQLCompiler`` objects are not documented, but the only thing we need to know
about them is that they have a ``compile()`` method which returns a tuple
containing a SQL string, and the parameters to be interpolated into that
containing an SQL string, and the parameters to be interpolated into that
string. In most cases, you don't need to use it directly and can pass it on to
``process_lhs()`` and ``process_rhs()``.

@@ -92,7 +92,7 @@ example, ``process_lhs`` returns ``('"author"."name"', [])`` and
parameters for the left hand side, but this would depend on the object we have,
so we still need to include them in the parameters we return.

Finally we combine the parts into a SQL expression with ``<>``, and supply all
Finally we combine the parts into an SQL expression with ``<>``, and supply all
the parameters for the query. We then return a tuple containing the generated
SQL string and the parameters.

+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ makes it possible to refer to model field values and perform database
operations using them without actually having to pull them out of the  database
into Python memory.

Instead, Django uses the ``F()`` object to generate a SQL expression that
Instead, Django uses the ``F()`` object to generate an SQL expression that
describes the required operation at the database level.

This is easiest to understand through an example. Normally, one might do
Loading