Fixed typos in comments and docs.

This commit is contained in:
luz.paz 2018-08-01 12:55:53 -04:00 committed by Tim Graham
parent 4263cd0e09
commit 97e637a87f
20 changed files with 22 additions and 23 deletions

View File

@ -276,7 +276,7 @@ class PermissionsMixin(models.Model):
def has_module_perms(self, app_label):
"""
Return True if the user has any permissions in the given app label.
Use simlar logic as has_perm(), above.
Use similar logic as has_perm(), above.
"""
# Active superusers have all permissions.
if self.is_active and self.is_superuser:

View File

@ -31,7 +31,7 @@ class PostGISOperator(SpatialOperator):
# geography type.
self.geography = geography
# Only a subset of the operators and functions are available for the
# raster type. Lookups that don't suport raster will be converted to
# raster type. Lookups that don't support raster will be converted to
# polygons. If the raster argument is set to BILATERAL, then the
# operator cannot handle mixed geom-raster lookups.
self.raster = raster

View File

@ -94,7 +94,7 @@ class Feature(GDALBase):
@property
def geom_type(self):
"Return the OGR Geometry Type for this Feture."
"Return the OGR Geometry Type for this Feature."
return OGRGeomType(capi.get_fd_geom_type(self._layer._ldefn))
# #### Feature Methods ####

View File

@ -188,7 +188,7 @@ class Deserializer:
return self
def __next__(self):
"""Iteration iterface -- return the next item in the stream"""
"""Iteration interface -- return the next item in the stream"""
raise NotImplementedError('subclasses of Deserializer must provide a __next__() method')

View File

@ -103,7 +103,7 @@ class Operation:
def allow_migrate_model(self, connection_alias, model):
"""
Return wether or not a model may be migrated.
Return whether or not a model may be migrated.
This is a thin wrapper around router.allow_migrate_model() that
preemptively rejects any proxy, swapped out, or unmanaged model.

View File

@ -142,7 +142,7 @@ class WhereNode(tree.Node):
def clone(self):
"""
Create a clone of the tree. Must only be called on root nodes (nodes
with empty subtree_parents). Childs must be either (Contraint, lookup,
with empty subtree_parents). Childs must be either (Constraint, lookup,
value) tuples, or objects supporting .clone().
"""
clone = self.__class__._new_instance(

View File

@ -760,7 +760,7 @@ class Variable:
# catching. Since this should only happen at compile time, that's
# probably OK.
# Try to interpret values containg a period or an 'e'/'E'
# Try to interpret values containing a period or an 'e'/'E'
# (possibly scientific notation) as a float; otherwise, try int.
if '.' in var or 'e' in var.lower():
self.literal = float(var)

View File

@ -222,8 +222,8 @@ def stringformat(value, arg):
"""
Format the variable according to the arg, a string formatting specifier.
This specifier uses Python string formating syntax, with the exception that
the leading "%" is dropped.
This specifier uses Python string formatting syntax, with the exception
that the leading "%" is dropped.
See https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
for documentation of Python string formatting.

View File

@ -362,7 +362,7 @@ but for now, remember the three-step guide to making model changes:
The reason that there are separate commands to make and apply migrations is
because you'll commit migrations to your version control system and ship them
with your app; they not only make your development easier, they're also
useable by other developers and in production.
usable by other developers and in production.
Read the :doc:`django-admin documentation </ref/django-admin>` for full
information on what the ``manage.py`` utility can do.

View File

@ -742,7 +742,7 @@ Next, start up the Django development server:
Finally, browse to ``http://localhost:8000/admin/``, and log in with the user
you just created. Browse to any of the ``WorldBorder`` entries -- the borders
may be edited by clicking on a polygon and dragging the vertexes to the desired
may be edited by clicking on a polygon and dragging the vertices to the desired
position.
.. _OpenLayers: https://openlayers.org/

View File

@ -664,7 +664,7 @@ For example::
# Primary keys compared
MyModel(id=1) == MyModel(id=1)
MyModel(id=1) != MyModel(id=2)
# Primay keys are None
# Primary keys are None
MyModel(id=None) != MyModel(id=None)
# Same instance
instance = MyModel(id=None)

View File

@ -749,7 +749,6 @@ url
urljoins
urlpatterns
urls
useable
username
usernames
utc

View File

@ -347,7 +347,7 @@ class ChangeListTests(TestCase):
"""
Regression test for #13902: When using a ManyToMany in list_filter,
results shouldn't appear more than once. Model managed in the
admin inherits from the one that defins the relationship.
admin inherits from the one that defines the relationship.
"""
lead = Musician.objects.create(name='John')
four = Quartet.objects.create(name='The Beatles')

View File

@ -1760,7 +1760,7 @@ class AdminViewPermissionsTest(TestCase):
self.client.get(reverse('admin:logout'))
# view user should be able to view the article but not change any of them
# (the POST can be sent, but no modification occures)
# (the POST can be sent, but no modification occurs)
self.client.force_login(self.viewuser)
response = self.client.get(article_changelist_url)
self.assertEqual(response.status_code, 200)
@ -2240,7 +2240,7 @@ class AdminViewPermissionsTest(TestCase):
def test_post_save_message_no_forbidden_links_visible(self):
"""
Post-save message shouldn't contain a link to the change form if the
user doen't have the change permission.
user doesn't have the change permission.
"""
self.client.force_login(self.adduser)
# Emulate Article creation for user with add-only permission.
@ -3607,7 +3607,7 @@ class AdminCustomQuerysetTest(TestCase):
# Test for #14529. only() is used in ModelAdmin.get_queryset()
# model has __str__ method
t = Telegram.objects.create(title="Frist Telegram")
t = Telegram.objects.create(title="First Telegram")
self.assertEqual(Telegram.objects.count(), 1)
response = self.client.get(reverse('admin:admin_views_telegram_change', args=(t.pk,)))
self.assertEqual(response.status_code, 200)

View File

@ -112,5 +112,5 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase):
self.assertNotEqual(sigint_handler, signal.SIG_IGN)
with mock.patch('subprocess.check_call', new=_mock_subprocess_call):
DatabaseClient.runshell_db({})
# dbshell restores the orignal handler.
# dbshell restores the original handler.
self.assertEqual(sigint_handler, signal.getsignal(signal.SIGINT))

View File

@ -317,7 +317,7 @@ class SelectDateWidgetTest(WidgetTest):
def test_selectdate_empty_label(self):
w = SelectDateWidget(years=('2014',), empty_label='empty_label')
# Rendering the default state with empty_label setted as string.
# Rendering the default state with empty_label set as string.
self.assertInHTML('<option selected value="">empty_label</option>', w.render('mydate', ''), count=3)
w = SelectDateWidget(years=('2014',), empty_label=('empty_year', 'empty_month', 'empty_day'))

View File

@ -733,7 +733,7 @@ class CookieTests(unittest.TestCase):
# Chunks without an equals sign appear as unnamed values per
# https://bugzilla.mozilla.org/show_bug.cgi?id=169091
self.assertIn('django_language', parse_cookie('abc=def; unnamed; django_language=en'))
# Even a double quote may be an unamed value.
# Even a double quote may be an unnamed value.
self.assertEqual(parse_cookie('a=b; "; c=d'), {'a': 'b', '': '"', 'c': 'd'})
# Spaces in names and values, and an equals sign in values.
self.assertEqual(parse_cookie('a b c=d e = f; gh=i'), {'a b c': 'd e = f', 'gh': 'i'})

View File

@ -81,7 +81,7 @@ class SchemaIndexesNotPostgreSQLTests(TransactionTestCase):
opclasses=['varchar_pattern_ops'],
)
with connection.schema_editor() as editor:
# This would error if opclasses weren't ingored.
# This would error if opclasses weren't ignored.
editor.add_index(IndexedArticle2, index)

View File

@ -376,7 +376,7 @@ class ModelPaginationTests(TestCase):
def test_paginating_unordered_object_list_raises_warning(self):
"""
Unordered object list warning with an object that has an orderd
Unordered object list warning with an object that has an ordered
attribute but not a model attribute.
"""
class ObjectList:

View File

@ -108,7 +108,7 @@ class CacheTagTests(SimpleTestCase):
'As plurdled gabbleblotchits/On a lurgid bee/'
'That mordiously hath bitled out/Its earted jurtles/'
'Into a rancid festering/Or else I shall rend thee in the gobberwarts'
'with my blurglecruncheon/See if I dont.'
'with my blurglecruncheon/See if I don\'t.'
),
}
)