From fef3f50e319bd691c8fd3313d982b6c07d66445c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 4 May 2016 02:30:48 +0300 Subject: [PATCH] [1.9.x] Normalized "an SQL" spelling. Backport of 575a9a791e62de7550761970dc6797271d956c57 from master --- django/db/backends/base/operations.py | 4 ++-- django/db/models/expressions.py | 2 +- django/db/models/fields/related_descriptors.py | 4 ++-- docs/howto/custom-lookups.txt | 4 ++-- docs/ref/models/expressions.txt | 2 +- docs/releases/1.8.txt | 2 +- docs/topics/testing/overview.txt | 2 +- tests/schema/tests.py | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py index 5d3cddff9d..643c922748 100644 --- a/django/db/backends/base/operations.py +++ b/django/db/backends/base/operations.py @@ -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): """ diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index b5586686a2..f2663752e0 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -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)' diff --git a/django/db/models/fields/related_descriptors.py b/django/db/models/fields/related_descriptors.py index abfa7283ae..5bfac8fc69 100644 --- a/django/db/models/fields/related_descriptors.py +++ b/django/db/models/fields/related_descriptors.py @@ -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) diff --git a/docs/howto/custom-lookups.txt b/docs/howto/custom-lookups.txt index 87a388283a..0f34534182 100644 --- a/docs/howto/custom-lookups.txt +++ b/docs/howto/custom-lookups.txt @@ -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. diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 223c0f6460..0a1e74d9e8 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -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 diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index c4b6752c97..7f1a86c4e9 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -651,7 +651,7 @@ Tests * Added test client support for file uploads with file-like objects. -* A shared cache is now used when testing with a SQLite in-memory database when +* A shared cache is now used when testing with an SQLite in-memory database when using Python 3.4+ and SQLite 3.7.13+. This allows sharing the database between threads. diff --git a/docs/topics/testing/overview.txt b/docs/topics/testing/overview.txt index 5be9a88787..f8c8f2486e 100644 --- a/docs/topics/testing/overview.txt +++ b/docs/topics/testing/overview.txt @@ -179,7 +179,7 @@ control the particular collation used by the test database. See the :doc:`settings documentation ` for details of these and other advanced settings. -If using a SQLite in-memory database with Python 3.4+ and SQLite 3.7.13+, +If using an SQLite in-memory database with Python 3.4+ and SQLite 3.7.13+, `shared cache `_ will be enabled, so you can write tests with ability to share the database between threads. diff --git a/tests/schema/tests.py b/tests/schema/tests.py index 052f72a3bf..e200f34164 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -1569,7 +1569,7 @@ class SchemaTests(TransactionTestCase): editor.create_model(Thing) except OperationalError as e: self.fail("Errors when applying initial migration for a model " - "with a table named after a SQL reserved word: %s" % e) + "with a table named after an SQL reserved word: %s" % e) # Check that it's there list(Thing.objects.all()) # Clean up that table