Ticket #28776: grammar-a-an-and.patch

File grammar-a-an-and.patch, 14.3 KB (added by Дилян Палаузов, 7 years ago)

a/an/and

  • django/contrib/contenttypes/views.py

    diff --git a/django/contrib/contenttypes/views.py b/django/contrib/contenttypes/views.py
    a b def shortcut(request, content_type_id, object_id):  
    5050
    5151        opts = obj._meta
    5252
    53         # First, look for an many-to-many relationship to Site.
     53        # First, look for a many-to-many relationship to Site.
    5454        for field in opts.many_to_many:
    5555            if field.remote_field.model is Site:
    5656                try:
  • django/contrib/staticfiles/finders.py

    diff --git a/django/contrib/staticfiles/finders.py b/django/contrib/staticfiles/finders.py
    a b class BaseStorageFinder(BaseFinder):  
    204204            raise ImproperlyConfigured("The staticfiles storage finder %r "
    205205                                       "doesn't have a storage class "
    206206                                       "assigned." % self.__class__)
    207         # Make sure we have an storage instance here.
     207        # Make sure we have a storage instance here.
    208208        if not isinstance(self.storage, (Storage, LazyObject)):
    209209            self.storage = self.storage()
    210210        super().__init__(*args, **kwargs)
  • django/core/files/uploadedfile.py

    diff --git a/django/core/files/uploadedfile.py b/django/core/files/uploadedfile.py
    a b __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',  
    1515
    1616class UploadedFile(File):
    1717    """
    18     A abstract uploaded file (``TemporaryUploadedFile`` and
     18    An abstract uploaded file (``TemporaryUploadedFile`` and
    1919    ``InMemoryUploadedFile`` are the built-in concrete subclasses).
    2020
    2121    An ``UploadedFile`` object behaves somewhat like a file object and
  • django/core/mail/backends/filebased.py

    diff --git a/django/core/mail/backends/filebased.py b/django/core/mail/backends/filebased.py
    a b class EmailBackend(ConsoleEmailBackend):  
    2121        if not isinstance(self.file_path, str):
    2222            raise ImproperlyConfigured('Path for saving emails is invalid: %r' % self.file_path)
    2323        self.file_path = os.path.abspath(self.file_path)
    24         # Make sure that self.file_path is an directory if it exists.
     24        # Make sure that self.file_path is a directory if it exists.
    2525        if os.path.exists(self.file_path) and not os.path.isdir(self.file_path):
    2626            raise ImproperlyConfigured(
    2727                'Path for saving email messages exists, but is not a directory: %s' % self.file_path
  • django/core/management/commands/loaddata.py

    diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
    a b class Command(BaseCommand):  
    7272            self.loaddata(fixture_labels)
    7373
    7474        # Close the DB connection -- unless we're still in a transaction. This
    75         # is required as a workaround for an  edge case in MySQL: if the same
     75        # is required as a workaround for an edge case in MySQL: if the same
    7676        # connection is used to create tables, load data, and query, the query
    7777        # can return incorrect results. See Django #7572, MySQL #37735.
    7878        if transaction.get_autocommit(self.using):
  • django/db/models/fields/related_lookups.py

    diff --git a/django/db/models/fields/related_lookups.py b/django/db/models/fields/related_lookups.py
    a b class RelatedIn(In):  
    6363        if isinstance(self.lhs, MultiColSource):
    6464            # For multicolumn lookups we need to build a multicolumn where clause.
    6565            # This clause is either a SubqueryConstraint (for values that need to be compiled to
    66             # SQL) or a OR-combined list of (col1 = val1 AND col2 = val2 AND ...) clauses.
     66            # SQL) or an OR-combined list of (col1 = val1 AND col2 = val2 AND ...) clauses.
    6767            from django.db.models.sql.where import WhereNode, SubqueryConstraint, AND, OR
    6868
    6969            root_constraint = WhereNode(connector=OR)
  • django/http/response.py

    diff --git a/django/http/response.py b/django/http/response.py
    a b class JsonResponse(HttpResponse):  
    489489    :param data: Data to be dumped into json. By default only ``dict`` objects
    490490      are allowed to be passed due to a security flaw before EcmaScript 5. See
    491491      the ``safe`` parameter for more information.
    492     :param encoder: Should be an json encoder class. Defaults to
     492    :param encoder: Should be a json encoder class. Defaults to
    493493      ``django.core.serializers.json.DjangoJSONEncoder``.
    494494    :param safe: Controls if only ``dict`` objects may be serialized. Defaults
    495495      to ``True``.
  • django/shortcuts.py

    diff --git a/django/shortcuts.py b/django/shortcuts.py
    a b def get_object_or_404(klass, *args, **kwargs):  
    7979    klass may be a Model, Manager, or QuerySet object. All other passed
    8080    arguments and keyword arguments are used in the get() query.
    8181
    82     Note: Like with get(), an MultipleObjectsReturned will be raised if more than one
     82    Note: Like with get(), a MultipleObjectsReturned will be raised if more than one
    8383    object is found.
    8484    """
    8585    queryset = _get_queryset(klass)
  • django/views/generic/edit.py

    diff --git a/django/views/generic/edit.py b/django/views/generic/edit.py
    a b class FormView(TemplateResponseMixin, BaseFormView):  
    159159
    160160class BaseCreateView(ModelFormMixin, ProcessFormView):
    161161    """
    162     Base view for creating an new object instance.
     162    Base view for creating a new object instance.
    163163
    164164    Using this base class requires subclassing to provide a response mixin.
    165165    """
  • docs/ref/settings.txt

    diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
    a b __ https://github.com/django/django/blob/master/django/utils/log.py  
    18621862Default: ``'logging.config.dictConfig'``
    18631863
    18641864A path to a callable that will be used to configure logging in the
    1865 Django project. Points at a instance of Python's :ref:`dictConfig
     1865Django project. Points at an instance of Python's :ref:`dictConfig
    18661866<logging-config-dictschema>` configuration method by default.
    18671867
    18681868If you set :setting:`LOGGING_CONFIG` to ``None``, the logging
  • docs/releases/1.1.txt

    diff --git a/docs/releases/1.1.txt b/docs/releases/1.1.txt
    a b detail in :doc:`the ORM aggregation documentation </topics/db/aggregation>`.  
    207207Query expressions
    208208~~~~~~~~~~~~~~~~~
    209209
    210 Queries can now refer to a another field on the query and can traverse
     210Queries can now refer to another field on the query and can traverse
    211211relationships to refer to fields on related models. This is implemented in the
    212212new :class:`~django.db.models.F` object; for full details, including examples,
    213213consult the :class:`F expressions documentation <django.db.models.F>`.
  • tests/admin_checks/tests.py

    diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py
    a b class SystemChecksTestCase(SimpleTestCase):  
    354354    def test_generic_inline_model_admin_non_generic_model(self):
    355355        """
    356356        A model without a GenericForeignKey raises problems if it's included
    357         in an GenericInlineModelAdmin definition.
     357        in a GenericInlineModelAdmin definition.
    358358        """
    359359        class BookInline(GenericStackedInline):
    360360            model = Book
  • tests/auth_tests/test_checks.py

    diff --git a/tests/auth_tests/test_checks.py b/tests/auth_tests/test_checks.py
    a b class UserModelChecksTests(SimpleTestCase):  
    5858    def test_username_non_unique(self):
    5959        """
    6060        A non-unique USERNAME_FIELD should raise an error only if we use the
    61         default authentication backend. Otherwise, an warning should be raised.
     61        default authentication backend. Otherwise, a warning should be raised.
    6262        """
    6363        errors = checks.run_checks()
    6464        self.assertEqual(errors, [
  • tests/files/tests.py

    diff --git a/tests/files/tests.py b/tests/files/tests.py
    a b class DimensionClosingBug(unittest.TestCase):  
    244244        """
    245245        # We need to inject a modified open() builtin into the images module
    246246        # that checks if the file was closed properly if the function is
    247         # called with a filename instead of an file object.
     247        # called with a filename instead of a file object.
    248248        # get_image_dimensions will call our catching_open instead of the
    249249        # regular builtin one.
    250250
  • tests/m2m_through_regress/models.py

    diff --git a/tests/m2m_through_regress/models.py b/tests/m2m_through_regress/models.py
    a b class Group(models.Model):  
    4040        return self.name
    4141
    4242
    43 # A set of models that use an non-abstract inherited model as the 'through' model.
     43# A set of models that use a non-abstract inherited model as the 'through' model.
    4444class A(models.Model):
    4545    a_text = models.CharField(max_length=20)
    4646
  • tests/managers_regress/tests.py

    diff --git a/tests/managers_regress/tests.py b/tests/managers_regress/tests.py
    a b class ManagersRegressionTests(TestCase):  
    6565            AbstractBase3.objects.all()
    6666
    6767    def test_custom_abstract_manager(self):
    68         # Accessing the manager on an abstract model with an custom
     68        # Accessing the manager on an abstract model with a custom
    6969        # manager should raise an attribute error with an appropriate
    7070        # message.
    7171        msg = "Manager isn't available; AbstractBase2 is abstract"
  • tests/many_to_one/tests.py

    diff --git a/tests/many_to_one/tests.py b/tests/many_to_one/tests.py
    a b class ManyToOneTests(TestCase):  
    570570        Third.objects.create(name='Third 1')
    571571        Third.objects.create(name='Third 2')
    572572        th = Third(name="testing")
    573         # The object isn't saved an thus the relation field is null - we won't even
     573        # The object isn't saved and thus the relation field is null - we won't even
    574574        # execute a query in this case.
    575575        with self.assertNumQueries(0):
    576576            self.assertEqual(th.child_set.count(), 0)
    577577        th.save()
    578         # Now the model is saved, so we will need to execute an query.
     578        # Now the model is saved, so we will need to execute a query.
    579579        with self.assertNumQueries(1):
    580580            self.assertEqual(th.child_set.count(), 0)
    581581
    class ManyToOneTests(TestCase):  
    591591
    592592        self.assertEqual(public_student.school, public_school)
    593593
    594         # Make sure the base manager is used so that an student can still access
     594        # Make sure the base manager is used so that a student can still access
    595595        # its related school even if the default manager doesn't normally
    596596        # allow it.
    597597        self.assertEqual(private_student.school, private_school)
  • tests/migrations/test_autodetector.py

    diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py
    a b class AutodetectorTests(TestCase):  
    11461146        # a CreateModel operation w/o any definition on the original model
    11471147        model_state_not_specified = ModelState("a", "model", [("id", models.AutoField(primary_key=True))])
    11481148        # Explicitly testing for None, since this was the issue in #23452 after
    1149         # a AlterFooTogether operation with e.g. () as value
     1149        # an AlterFooTogether operation with e.g. () as value
    11501150        model_state_none = ModelState("a", "model", [
    11511151            ("id", models.AutoField(primary_key=True))
    11521152        ], {
  • tests/migrations/test_commands.py

    diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
    a b class MigrateTests(MigrationTestBase):  
    155155            # Fails because "migrations_tribble" does not exist but needs to in
    156156            # order to make --fake-initial work.
    157157            call_command("migrate", "migrations", fake_initial=True, verbosity=0)
    158         # Fake a apply
     158        # Fake an apply
    159159        call_command("migrate", "migrations", fake=True, verbosity=0)
    160160        call_command("migrate", "migrations", fake=True, verbosity=0, database="other")
    161161        # Unmigrate everything
  • tests/model_regress/tests.py

    diff --git a/tests/model_regress/tests.py b/tests/model_regress/tests.py
    a b class ModelTests(TestCase):  
    188188
    189189    @skipUnlessDBFeature("supports_timezones")
    190190    def test_timezones(self):
    191         # Saving an updating with timezone-aware datetime Python objects.
     191        # Saving and updating with timezone-aware datetime Python objects.
    192192        # Regression test for #10443.
    193193        # The idea is that all these creations and saving should work without
    194194        # crashing. It's not rocket science.
  • tests/proxy_models/models.py

    diff --git a/tests/proxy_models/models.py b/tests/proxy_models/models.py
    a b class ManagerMixin(models.Model):  
    6969
    7070class OtherPerson(Person, ManagerMixin):
    7171    """
    72     A class with the default manager from Person, plus an secondary manager.
     72    A class with the default manager from Person, plus a secondary manager.
    7373    """
    7474    class Meta:
    7575        proxy = True
  • tests/requests/tests.py

    diff --git a/tests/requests/tests.py b/tests/requests/tests.py
    a b class RequestsTests(SimpleTestCase):  
    235235        self.assertEqual(response.cookies['c']['expires'], '')
    236236
    237237    def test_far_expiration(self):
    238         "Cookie will expire when an distant expiration time is provided"
     238        "Cookie will expire when a distant expiration time is provided"
    239239        response = HttpResponse()
    240240        response.set_cookie('datetime', expires=datetime(2028, 1, 1, 4, 5, 6))
    241241        datetime_cookie = response.cookies['datetime']
  • tests/staticfiles_tests/project/documents/cached/css/fonts/font.eot

    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 b  
    1 not really a EOT ;)
    2  No newline at end of file
     1not really an EOT ;)
     2 No newline at end of file
Back to Top