Opened 7 years ago

Last modified 7 years ago

#28776 closed Bug

Grammar a/an/and — at Initial Version

Reported by: Дилян Палаузов Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

diff --git a/django/contrib/contenttypes/views.py b/django/contrib/contenttypes/views.py
--- a/django/contrib/contenttypes/views.py
+++ b/django/contrib/contenttypes/views.py
@@ -50,7 +50,7 @@ def shortcut(request, content_type_id, object_id):
 
         opts = obj._meta
 
-        # First, look for an many-to-many relationship to Site.
+        # First, look for a many-to-many relationship to Site.
         for field in opts.many_to_many:
             if field.remote_field.model is Site:
                 try:
diff --git a/django/contrib/staticfiles/finders.py b/django/contrib/staticfiles/finders.py
--- a/django/contrib/staticfiles/finders.py
+++ b/django/contrib/staticfiles/finders.py
@@ -204,7 +204,7 @@ class BaseStorageFinder(BaseFinder):
             raise ImproperlyConfigured("The staticfiles storage finder %r "
                                        "doesn't have a storage class "
                                        "assigned." % self.__class__)
-        # Make sure we have an storage instance here.
+        # Make sure we have a storage instance here.
         if not isinstance(self.storage, (Storage, LazyObject)):
             self.storage = self.storage()
         super().__init__(*args, **kwargs)
diff --git a/django/core/files/uploadedfile.py b/django/core/files/uploadedfile.py
--- a/django/core/files/uploadedfile.py
+++ b/django/core/files/uploadedfile.py
@@ -15,7 +15,7 @@ __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',
 
 class UploadedFile(File):
     """
-    A abstract uploaded file (``TemporaryUploadedFile`` and
+    An abstract uploaded file (``TemporaryUploadedFile`` and
     ``InMemoryUploadedFile`` are the built-in concrete subclasses).
 
     An ``UploadedFile`` object behaves somewhat like a file object and
diff --git a/django/core/mail/backends/filebased.py b/django/core/mail/backends/filebased.py
--- a/django/core/mail/backends/filebased.py
+++ b/django/core/mail/backends/filebased.py
@@ -21,7 +21,7 @@ class EmailBackend(ConsoleEmailBackend):
         if not isinstance(self.file_path, str):
             raise ImproperlyConfigured('Path for saving emails is invalid: %r' % self.file_path)
         self.file_path = os.path.abspath(self.file_path)
-        # Make sure that self.file_path is an directory if it exists.
+        # Make sure that self.file_path is a directory if it exists.
         if os.path.exists(self.file_path) and not os.path.isdir(self.file_path):
             raise ImproperlyConfigured(
                 'Path for saving email messages exists, but is not a directory: %s' % self.file_path
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
--- a/django/core/management/commands/loaddata.py
+++ b/django/core/management/commands/loaddata.py
@@ -72,7 +72,7 @@ class Command(BaseCommand):
             self.loaddata(fixture_labels)
 
         # Close the DB connection -- unless we're still in a transaction. This
-        # is required as a workaround for an  edge case in MySQL: if the same
+        # is required as a workaround for an edge case in MySQL: if the same
         # connection is used to create tables, load data, and query, the query
         # can return incorrect results. See Django #7572, MySQL #37735.
         if transaction.get_autocommit(self.using):
diff --git a/django/db/models/fields/related_lookups.py b/django/db/models/fields/related_lookups.py
--- a/django/db/models/fields/related_lookups.py
+++ b/django/db/models/fields/related_lookups.py
@@ -63,7 +63,7 @@ class RelatedIn(In):
         if isinstance(self.lhs, MultiColSource):
             # For multicolumn lookups we need to build a multicolumn where clause.
             # This clause is either a SubqueryConstraint (for values that need to be compiled to
-            # SQL) or a OR-combined list of (col1 = val1 AND col2 = val2 AND ...) clauses.
+            # SQL) or an OR-combined list of (col1 = val1 AND col2 = val2 AND ...) clauses.
             from django.db.models.sql.where import WhereNode, SubqueryConstraint, AND, OR
 
             root_constraint = WhereNode(connector=OR)
diff --git a/django/http/response.py b/django/http/response.py
--- a/django/http/response.py
+++ b/django/http/response.py
@@ -489,7 +489,7 @@ class JsonResponse(HttpResponse):
     :param data: Data to be dumped into json. By default only ``dict`` objects
       are allowed to be passed due to a security flaw before EcmaScript 5. See
       the ``safe`` parameter for more information.
-    :param encoder: Should be an json encoder class. Defaults to
+    :param encoder: Should be a json encoder class. Defaults to
       ``django.core.serializers.json.DjangoJSONEncoder``.
     :param safe: Controls if only ``dict`` objects may be serialized. Defaults
       to ``True``.
diff --git a/django/shortcuts.py b/django/shortcuts.py
--- a/django/shortcuts.py
+++ b/django/shortcuts.py
@@ -79,7 +79,7 @@ def get_object_or_404(klass, *args, **kwargs):
     klass may be a Model, Manager, or QuerySet object. All other passed
     arguments and keyword arguments are used in the get() query.
 
-    Note: Like with get(), an MultipleObjectsReturned will be raised if more than one
+    Note: Like with get(), a MultipleObjectsReturned will be raised if more than one
     object is found.
     """
     queryset = _get_queryset(klass)
diff --git a/django/views/generic/edit.py b/django/views/generic/edit.py
--- a/django/views/generic/edit.py
+++ b/django/views/generic/edit.py
@@ -159,7 +159,7 @@ class FormView(TemplateResponseMixin, BaseFormView):
 
 class BaseCreateView(ModelFormMixin, ProcessFormView):
     """
-    Base view for creating an new object instance.
+    Base view for creating a new object instance.
 
     Using this base class requires subclassing to provide a response mixin.
     """
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -1862,7 +1862,7 @@ __ https://github.com/django/django/blob/master/django/utils/log.py
 Default: ``'logging.config.dictConfig'``
 
 A path to a callable that will be used to configure logging in the
-Django project. Points at a instance of Python's :ref:`dictConfig
+Django project. Points at an instance of Python's :ref:`dictConfig
 <logging-config-dictschema>` configuration method by default.
 
 If you set :setting:`LOGGING_CONFIG` to ``None``, the logging
diff --git a/docs/releases/1.1.txt b/docs/releases/1.1.txt
--- a/docs/releases/1.1.txt
+++ b/docs/releases/1.1.txt
@@ -207,7 +207,7 @@ detail in :doc:`the ORM aggregation documentation </topics/db/aggregation>`.
 Query expressions
 ~~~~~~~~~~~~~~~~~
 
-Queries can now refer to a another field on the query and can traverse
+Queries can now refer to another field on the query and can traverse
 relationships to refer to fields on related models. This is implemented in the
 new :class:`~django.db.models.F` object; for full details, including examples,
 consult the :class:`F expressions documentation <django.db.models.F>`.
diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py
--- a/tests/admin_checks/tests.py
+++ b/tests/admin_checks/tests.py
@@ -354,7 +354,7 @@ class SystemChecksTestCase(SimpleTestCase):
     def test_generic_inline_model_admin_non_generic_model(self):
         """
         A model without a GenericForeignKey raises problems if it's included
-        in an GenericInlineModelAdmin definition.
+        in a GenericInlineModelAdmin definition.
         """
         class BookInline(GenericStackedInline):
             model = Book
diff --git a/tests/auth_tests/test_checks.py b/tests/auth_tests/test_checks.py
--- a/tests/auth_tests/test_checks.py
+++ b/tests/auth_tests/test_checks.py
@@ -58,7 +58,7 @@ class UserModelChecksTests(SimpleTestCase):
     def test_username_non_unique(self):
         """
         A non-unique USERNAME_FIELD should raise an error only if we use the
-        default authentication backend. Otherwise, an warning should be raised.
+        default authentication backend. Otherwise, a warning should be raised.
         """
         errors = checks.run_checks()
         self.assertEqual(errors, [
diff --git a/tests/files/tests.py b/tests/files/tests.py
--- a/tests/files/tests.py
+++ b/tests/files/tests.py
@@ -244,7 +244,7 @@ class DimensionClosingBug(unittest.TestCase):
         """
         # We need to inject a modified open() builtin into the images module
         # that checks if the file was closed properly if the function is
-        # called with a filename instead of an file object.
+        # called with a filename instead of a file object.
         # get_image_dimensions will call our catching_open instead of the
         # regular builtin one.
 
diff --git a/tests/m2m_through_regress/models.py b/tests/m2m_through_regress/models.py
--- a/tests/m2m_through_regress/models.py
+++ b/tests/m2m_through_regress/models.py
@@ -40,7 +40,7 @@ class Group(models.Model):
         return self.name
 
 
-# A set of models that use an non-abstract inherited model as the 'through' model.
+# A set of models that use a non-abstract inherited model as the 'through' model.
 class A(models.Model):
     a_text = models.CharField(max_length=20)
 
diff --git a/tests/managers_regress/tests.py b/tests/managers_regress/tests.py
--- a/tests/managers_regress/tests.py
+++ b/tests/managers_regress/tests.py
@@ -65,7 +65,7 @@ class ManagersRegressionTests(TestCase):
             AbstractBase3.objects.all()
 
     def test_custom_abstract_manager(self):
-        # Accessing the manager on an abstract model with an custom
+        # Accessing the manager on an abstract model with a custom
         # manager should raise an attribute error with an appropriate
         # message.
         msg = "Manager isn't available; AbstractBase2 is abstract"
diff --git a/tests/many_to_one/tests.py b/tests/many_to_one/tests.py
--- a/tests/many_to_one/tests.py
+++ b/tests/many_to_one/tests.py
@@ -570,12 +570,12 @@ class ManyToOneTests(TestCase):
         Third.objects.create(name='Third 1')
         Third.objects.create(name='Third 2')
         th = Third(name="testing")
-        # The object isn't saved an thus the relation field is null - we won't even
+        # The object isn't saved and thus the relation field is null - we won't even
         # execute a query in this case.
         with self.assertNumQueries(0):
             self.assertEqual(th.child_set.count(), 0)
         th.save()
-        # Now the model is saved, so we will need to execute an query.
+        # Now the model is saved, so we will need to execute a query.
         with self.assertNumQueries(1):
             self.assertEqual(th.child_set.count(), 0)
 
@@ -591,7 +591,7 @@ class ManyToOneTests(TestCase):
 
         self.assertEqual(public_student.school, public_school)
 
-        # Make sure the base manager is used so that an student can still access
+        # Make sure the base manager is used so that a student can still access
         # its related school even if the default manager doesn't normally
         # allow it.
         self.assertEqual(private_student.school, private_school)
diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py
--- a/tests/migrations/test_autodetector.py
+++ b/tests/migrations/test_autodetector.py
@@ -1146,7 +1146,7 @@ class AutodetectorTests(TestCase):
         # a CreateModel operation w/o any definition on the original model
         model_state_not_specified = ModelState("a", "model", [("id", models.AutoField(primary_key=True))])
         # Explicitly testing for None, since this was the issue in #23452 after
-        # a AlterFooTogether operation with e.g. () as value
+        # an AlterFooTogether operation with e.g. () as value
         model_state_none = ModelState("a", "model", [
             ("id", models.AutoField(primary_key=True))
         ], {
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -155,7 +155,7 @@ class MigrateTests(MigrationTestBase):
             # Fails because "migrations_tribble" does not exist but needs to in
             # order to make --fake-initial work.
             call_command("migrate", "migrations", fake_initial=True, verbosity=0)
-        # Fake a apply
+        # Fake an apply
         call_command("migrate", "migrations", fake=True, verbosity=0)
         call_command("migrate", "migrations", fake=True, verbosity=0, database="other")
         # Unmigrate everything
diff --git a/tests/model_regress/tests.py b/tests/model_regress/tests.py
--- a/tests/model_regress/tests.py
+++ b/tests/model_regress/tests.py
@@ -188,7 +188,7 @@ class ModelTests(TestCase):
 
     @skipUnlessDBFeature("supports_timezones")
     def test_timezones(self):
-        # Saving an updating with timezone-aware datetime Python objects.
+        # Saving and updating with timezone-aware datetime Python objects.
         # Regression test for #10443.
         # The idea is that all these creations and saving should work without
         # crashing. It's not rocket science.
diff --git a/tests/proxy_models/models.py b/tests/proxy_models/models.py
--- a/tests/proxy_models/models.py
+++ b/tests/proxy_models/models.py
@@ -69,7 +69,7 @@ class ManagerMixin(models.Model):
 
 class OtherPerson(Person, ManagerMixin):
     """
-    A class with the default manager from Person, plus an secondary manager.
+    A class with the default manager from Person, plus a secondary manager.
     """
     class Meta:
         proxy = True
diff --git a/tests/requests/tests.py b/tests/requests/tests.py
--- a/tests/requests/tests.py
+++ b/tests/requests/tests.py
@@ -235,7 +235,7 @@ class RequestsTests(SimpleTestCase):
         self.assertEqual(response.cookies['c']['expires'], '')
 
     def test_far_expiration(self):
-        "Cookie will expire when an distant expiration time is provided"
+        "Cookie will expire when a distant expiration time is provided"
         response = HttpResponse()
         response.set_cookie('datetime', expires=datetime(2028, 1, 1, 4, 5, 6))
         datetime_cookie = response.cookies['datetime']
diff --git a/tests/staticfiles_tests/project/documents/cached/css/fonts/font.eot b/tests/staticfiles_tests/project/documents/cached/css/fonts/font.eot
--- a/tests/staticfiles_tests/project/documents/cached/css/fonts/font.eot
+++ b/tests/staticfiles_tests/project/documents/cached/css/fonts/font.eot
@@ -1 +1 @@
-not really a EOT ;)
\ No newline at end of file
+not really an EOT ;)
\ No newline at end of file

Change History (1)

by Дилян Палаузов, 7 years ago

Attachment: grammar-a-an-and.patch added

a/an/and

Note: See TracTickets for help on using tickets.
Back to Top