Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed many typos in comments and docstrings.

Thanks Piotr Kasprzyk for help with the patch.
  • Loading branch information...
commit 0d912258921a442c48d5787228db2db5af7e8fa5 1 parent 6acaa52
Rodolfo Carvalho rhcarvalho authored timgraham committed
Showing with 208 additions and 208 deletions.
  1. +4 −4 django/contrib/admin/tests.py
  2. +1 −1  django/contrib/admin/utils.py
  3. +1 −1  django/contrib/auth/decorators.py
  4. +1 −1  django/contrib/auth/hashers.py
  5. +1 −1  django/contrib/auth/tests/test_management.py
  6. +1 −1  django/contrib/comments/views/moderation.py
  7. +2 −2 django/contrib/flatpages/tests/test_csrf.py
  8. +4 −4 django/contrib/flatpages/tests/test_middleware.py
  9. +1 −1  django/contrib/flatpages/tests/test_templatetags.py
  10. +2 −2 django/contrib/flatpages/tests/test_views.py
  11. +1 −1  django/contrib/formtools/tests/tests.py
  12. +2 −2 django/contrib/formtools/wizard/views.py
  13. +2 −2 django/contrib/gis/db/backends/base.py
  14. +2 −2 django/contrib/gis/db/backends/oracle/operations.py
  15. +1 −1  django/contrib/gis/db/backends/postgis/introspection.py
  16. +3 −3 django/contrib/gis/db/backends/postgis/operations.py
  17. +1 −1  django/contrib/gis/db/backends/spatialite/creation.py
  18. +2 −2 django/contrib/gis/db/backends/spatialite/operations.py
  19. +2 −2 django/contrib/gis/db/models/query.py
  20. +1 −1  django/contrib/gis/db/models/sql/compiler.py
  21. +1 −1  django/contrib/gis/feeds.py
  22. +4 −4 django/contrib/gis/gdal/prototypes/errcheck.py
  23. +1 −1  django/contrib/gis/gdal/srs.py
  24. +1 −1  django/contrib/gis/gdal/tests/test_envelope.py
  25. +1 −1  django/contrib/gis/gdal/tests/test_geom.py
  26. +1 −1  django/contrib/gis/geoip/base.py
  27. +1 −1  django/contrib/gis/geoip/prototypes.py
  28. +2 −2 django/contrib/gis/geos/geometry.py
  29. +2 −2 django/contrib/gis/geos/libgeos.py
  30. +4 −4 django/contrib/gis/geos/tests/test_geos.py
  31. +1 −1  django/contrib/gis/maps/google/overlays.py
  32. +1 −1  django/contrib/gis/measure.py
  33. +2 −2 django/contrib/gis/static/gis/js/OLMapWidget.js
  34. +1 −1  django/contrib/gis/tests/distapp/tests.py
  35. +2 −2 django/contrib/gis/tests/geoapp/tests.py
  36. +1 −1  django/contrib/gis/tests/inspectapp/tests.py
  37. +1 −1  django/contrib/gis/tests/maps/tests.py
  38. +5 −5 django/contrib/gis/tests/test_measure.py
  39. +1 −1  django/contrib/gis/utils/layermapping.py
  40. +1 −1  django/core/files/uploadhandler.py
  41. +1 −1  django/core/handlers/wsgi.py
  42. +2 −2 django/core/management/base.py
  43. +1 −1  django/core/management/commands/inspectdb.py
  44. +1 −1  django/core/management/commands/migrate.py
  45. +1 −1  django/core/management/commands/validate.py
  46. +1 −1  django/core/management/templates.py
  47. +1 −1  django/core/signing.py
  48. +2 −2 django/db/backends/__init__.py
  49. +2 −2 django/db/backends/oracle/base.py
  50. +1 −1  django/db/backends/schema.py
  51. +1 −1  django/db/migrations/executor.py
  52. +1 −1  django/db/migrations/loader.py
  53. +1 −1  django/db/migrations/migration.py
  54. +4 −4 django/db/migrations/optimizer.py
  55. +2 −2 django/db/models/deletion.py
  56. +2 −2 django/db/models/fields/__init__.py
  57. +5 −5 django/db/models/query.py
  58. +1 −1  django/db/models/query_utils.py
  59. +1 −1  django/db/models/related.py
  60. +1 −1  django/db/models/sql/compiler.py
  61. +2 −2 django/db/models/sql/query.py
  62. +1 −1  django/db/transaction.py
  63. +1 −1  django/dispatch/dispatcher.py
  64. +1 −1  django/forms/forms.py
  65. +1 −1  django/forms/formsets.py
  66. +3 −3 django/http/multipartparser.py
  67. +2 −2 django/http/response.py
  68. +1 −1  django/template/base.py
  69. +2 −2 django/template/defaulttags.py
  70. +1 −1  django/test/_doctest.py
  71. +1 −1  django/test/signals.py
  72. +1 −1  django/test/testcases.py
  73. +1 −1  django/test/utils.py
  74. +1 −1  django/utils/functional.py
  75. +5 −5 django/utils/html.py
  76. +1 −1  django/utils/ipv6.py
  77. +1 −1  django/utils/jslex.py
  78. +1 −1  django/utils/regex_helper.py
  79. +1 −1  django/utils/six.py
  80. +4 −4 tests/admin_changelist/tests.py
  81. +3 −3 tests/admin_inlines/tests.py
  82. +1 −1  tests/admin_ordering/tests.py
  83. +2 −2 tests/admin_scripts/tests.py
  84. +14 −14 tests/admin_views/tests.py
  85. +2 −2 tests/aggregation_regress/tests.py
  86. +5 −5 tests/backends/tests.py
  87. +1 −1  tests/basic/tests.py
  88. +1 −1  tests/cache/tests.py
  89. +1 −1  tests/defer/tests.py
  90. +1 −1  tests/extra_regress/tests.py
  91. +1 −1  tests/field_subclassing/fields.py
  92. +2 −2 tests/field_subclassing/tests.py
  93. +1 −1  tests/file_storage/tests.py
  94. +1 −1  tests/fixtures/tests.py
  95. +3 −3 tests/fixtures_regress/tests.py
  96. +1 −1  tests/foreign_object/models.py
  97. +1 −1  tests/forms_tests/tests/test_extra.py
  98. +1 −1  tests/forms_tests/tests/test_forms.py
  99. +1 −1  tests/generic_views/urls.py
  100. +1 −1  tests/i18n/test_extraction.py
  101. +2 −2 tests/inspectdb/tests.py
  102. +1 −1  tests/lookup/tests.py
  103. +2 −2 tests/m2m_recursive/tests.py
  104. +3 −3 tests/mail/tests.py
  105. +1 −1  tests/model_fields/tests.py
  106. +1 −1  tests/model_forms_regress/tests.py
  107. +1 −1  tests/model_regress/tests.py
  108. +1 −1  tests/modeladmin/tests.py
  109. +5 −5 tests/multiple_database/tests.py
  110. +2 −2 tests/mutually_referential/models.py
  111. +1 −1  tests/pagination/tests.py
  112. +1 −1  tests/queries/models.py
  113. +2 −2 tests/queries/tests.py
  114. +1 −1  tests/raw_query/tests.py
  115. +1 −1  tests/servers/tests.py
  116. +1 −1  tests/settings_tests/tests.py
  117. +1 −1  tests/template_tests/test_loaders.py
  118. +1 −1  tests/template_tests/tests.py
  119. +1 −1  tests/test_runner/tests.py
  120. +1 −1  tests/transactions_regress/tests.py
  121. +1 −1  tests/view_tests/generic_urls.py
8 django/contrib/admin/tests.py
View
@@ -54,7 +54,7 @@ def wait_loaded_tag(self, tag_name, timeout=10):
def wait_for(self, css_selector, timeout=10):
"""
- Helper function that blocks until an css selector is found on the page.
+ Helper function that blocks until a CSS selector is found on the page.
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
@@ -65,7 +65,7 @@ def wait_for(self, css_selector, timeout=10):
def wait_for_text(self, css_selector, text, timeout=10):
"""
- Helper function that blocks until the text is found in the css selector.
+ Helper function that blocks until the text is found in the CSS selector.
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
@@ -77,7 +77,7 @@ def wait_for_text(self, css_selector, text, timeout=10):
def wait_for_value(self, css_selector, text, timeout=10):
"""
- Helper function that blocks until the value is found in the css selector.
+ Helper function that blocks until the value is found in the CSS selector.
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
@@ -96,7 +96,7 @@ def wait_page_loaded(self):
# Wait for the next page to be loaded
self.wait_loaded_tag('body')
except TimeoutException:
- # IE7 occasionnally returns an error "Internet Explorer cannot
+ # IE7 occasionally returns an error "Internet Explorer cannot
# display the webpage" and doesn't load the next page. We just
# ignore it.
pass
2  django/contrib/admin/utils.py
View
@@ -108,7 +108,7 @@ def flatten_fieldsets(fieldsets):
def get_deleted_objects(objs, opts, user, admin_site, using):
"""
Find all objects related to ``objs`` that should also be deleted. ``objs``
- must be a homogenous iterable of objects (e.g. a QuerySet).
+ must be a homogeneous iterable of objects (e.g. a QuerySet).
Returns a nested list of strings suitable for display in the
template with the ``unordered_list`` filter.
2  django/contrib/auth/decorators.py
View
@@ -56,7 +56,7 @@ def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login
def permission_required(perm, login_url=None, raise_exception=False):
"""
Decorator for views that checks whether a user has a particular permission
- enabled, redirecting to the log-in page if neccesary.
+ enabled, redirecting to the log-in page if necessary.
If the raise_exception parameter is given the PermissionDenied exception
is raised.
"""
2  django/contrib/auth/hashers.py
View
@@ -186,7 +186,7 @@ def _load_library(self):
def salt(self):
"""
- Generates a cryptographically secure nonce salt in ascii
+ Generates a cryptographically secure nonce salt in ASCII
"""
return get_random_string()
2  django/contrib/auth/tests/test_management.py
View
@@ -39,7 +39,7 @@ def getpass(prompt=b'Password: ', stream=None):
def mock_input(prompt):
# prompt should be encoded in Python 2. This line will raise an
- # Exception if prompt contains unencoded non-ascii on Python 2.
+ # Exception if prompt contains unencoded non-ASCII on Python 2.
prompt = str(prompt)
assert str('__proxy__') not in prompt
response = ''
2  django/contrib/comments/views/moderation.py
View
@@ -90,7 +90,7 @@ def approve(request, comment_id, next=None):
template.RequestContext(request)
)
-# The following functions actually perform the various flag/aprove/delete
+# The following functions actually perform the various flag/approve/delete
# actions. They've been broken out into separate functions to that they
# may be called from admin actions.
4 django/contrib/flatpages/tests/test_csrf.py
View
@@ -51,13 +51,13 @@ def test_view_authenticated_flatpage(self):
self.assertContains(response, "<p>Isn't it sekrit!</p>")
def test_fallback_flatpage(self):
- "A flatpage can be served by the fallback middlware"
+ "A flatpage can be served by the fallback middleware"
response = self.client.get('/flatpage/')
self.assertEqual(response.status_code, 200)
self.assertContains(response, "<p>Isn't it flat!</p>")
def test_fallback_non_existent_flatpage(self):
- "A non-existent flatpage raises a 404 when served by the fallback middlware"
+ "A non-existent flatpage raises a 404 when served by the fallback middleware"
response = self.client.get('/no_such_flatpage/')
self.assertEqual(response.status_code, 404)
8 django/contrib/flatpages/tests/test_middleware.py
View
@@ -48,13 +48,13 @@ def test_view_authenticated_flatpage(self):
self.assertContains(response, "<p>Isn't it sekrit!</p>")
def test_fallback_flatpage(self):
- "A flatpage can be served by the fallback middlware"
+ "A flatpage can be served by the fallback middleware"
response = self.client.get('/flatpage/')
self.assertEqual(response.status_code, 200)
self.assertContains(response, "<p>Isn't it flat!</p>")
def test_fallback_non_existent_flatpage(self):
- "A non-existent flatpage raises a 404 when served by the fallback middlware"
+ "A non-existent flatpage raises a 404 when served by the fallback middleware"
response = self.client.get('/no_such_flatpage/')
self.assertEqual(response.status_code, 404)
@@ -116,12 +116,12 @@ def test_redirect_view_non_existent_flatpage(self):
self.assertEqual(response.status_code, 404)
def test_redirect_fallback_flatpage(self):
- "A flatpage can be served by the fallback middlware and should add a slash"
+ "A flatpage can be served by the fallback middleware and should add a slash"
response = self.client.get('/flatpage')
self.assertRedirects(response, '/flatpage/', status_code=301)
def test_redirect_fallback_non_existent_flatpage(self):
- "A non-existent flatpage raises a 404 when served by the fallback middlware and should not add a slash"
+ "A non-existent flatpage raises a 404 when served by the fallback middleware and should not add a slash"
response = self.client.get('/no_such_flatpage')
self.assertEqual(response.status_code, 404)
2  django/contrib/flatpages/tests/test_templatetags.py
View
@@ -88,7 +88,7 @@ def test_get_flatpages_with_prefix_for_anon_user(self):
@skipIfCustomUser
def test_get_flatpages_with_prefix_for_user(self):
- "The flatpage template tag retrive prefixed flatpages for an authenticated user"
+ "The flatpage template tag retrieve prefixed flatpages for an authenticated user"
me = User.objects.create_user('testuser', 'test@example.com', 's3krit')
out = Template(
"{% load flatpages %}"
4 django/contrib/flatpages/tests/test_views.py
View
@@ -53,7 +53,7 @@ def test_fallback_flatpage(self):
self.assertEqual(response.status_code, 404)
def test_fallback_non_existent_flatpage(self):
- "A non-existent flatpage won't be served if the fallback middlware is disabled"
+ "A non-existent flatpage won't be served if the fallback middleware is disabled"
response = self.client.get('/no_such_flatpage/')
self.assertEqual(response.status_code, 404)
@@ -109,7 +109,7 @@ def test_redirect_fallback_flatpage(self):
self.assertEqual(response.status_code, 404)
def test_redirect_fallback_non_existent_flatpage(self):
- "A non-existent flatpage won't be served if the fallback middlware is disabled and should not add a slash"
+ "A non-existent flatpage won't be served if the fallback middleware is disabled and should not add a slash"
response = self.client.get('/no_such_flatpage')
self.assertEqual(response.status_code, 404)
2  django/contrib/formtools/tests/tests.py
View
@@ -58,7 +58,7 @@ def test_form_get(self):
"""
Test contrib.formtools.preview form retrieval.
- Use the client library to see if we can sucessfully retrieve
+ Use the client library to see if we can successfully retrieve
the form (mostly testing the setup ROOT_URLCONF
process). Verify that an additional hidden input field
is created to manage the stage.
4 django/contrib/formtools/wizard/views.py
View
@@ -368,7 +368,7 @@ def get_form_prefix(self, step=None, form=None):
def get_form_initial(self, step):
"""
Returns a dictionary which will be passed to the form for `step`
- as `initial`. If no initial data was provied while initializing the
+ as `initial`. If no initial data was provided while initializing the
form wizard, a empty dictionary will be returned.
"""
return self.initial_dict.get(step, {})
@@ -376,7 +376,7 @@ def get_form_initial(self, step):
def get_form_instance(self, step):
"""
Returns a object which will be passed to the form for `step`
- as `instance`. If no instance object was provied while initializing
+ as `instance`. If no instance object was provided while initializing
the form wizard, None will be returned.
"""
return self.instance_dict.get(step, None)
4 django/contrib/gis/db/backends/base.py
View
@@ -148,7 +148,7 @@ def spatial_ref_sys(self):
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
- SpatialRefSys objects to reduce redundnant code.
+ SpatialRefSys objects to reduce redundant code.
"""
# For pulling out the spheroid from the spatial reference string. This
# regular expression is used only if the user does not have GDAL installed.
@@ -304,7 +304,7 @@ def units(self):
def get_units(cls, wkt):
"""
Class method used by GeometryField on initialization to
- retrive the units on the given WKT, without having to use
+ retrieve the units on the given WKT, without having to use
any of the database fields.
"""
if gdal.HAS_GDAL:
4 django/contrib/gis/db/backends/oracle/operations.py
View
@@ -196,7 +196,7 @@ def get_distance(self, f, value, lookup_type):
else:
dist_param = value
- # dwithin lookups on oracle require a special string parameter
+ # dwithin lookups on Oracle require a special string parameter
# that starts with "distance=".
if lookup_type == 'dwithin':
dist_param = 'distance=%s' % dist_param
@@ -220,7 +220,7 @@ def transform_value(val, srid):
placeholder = '%s(%%s, %s)' % (self.transform, f.srid)
else:
placeholder = '%s'
- # No geometry value used for F expression, substitue in
+ # No geometry value used for F expression, substitute in
# the column name instead.
return placeholder % self.get_expression_column(value)
else:
2  django/contrib/gis/db/backends/postgis/introspection.py
View
@@ -51,7 +51,7 @@ def get_field_type(self, data_type, description):
if not self.postgis_types_reverse:
# If the PostGIS types reverse dictionary is not populated, do so
# now. In order to prevent unnecessary requests upon connection
- # intialization, the `data_types_reverse` dictionary is not updated
+ # initialization, the `data_types_reverse` dictionary is not updated
# with the PostGIS custom types until introspection is actually
# performed -- in other words, when this function is called.
self.postgis_types_reverse = self.get_postgis_types()
6 django/contrib/gis/db/backends/postgis/operations.py
View
@@ -290,7 +290,7 @@ def convert_extent(self, box):
def convert_extent3d(self, box3d):
"""
Returns a 6-tuple extent for the `Extent3D` aggregate by converting
- the 3d bounding-box text returnded by PostGIS (`box3d` argument), for
+ the 3d bounding-box text returned by PostGIS (`box3d` argument), for
example: "BOX3D(-90.0 30.0 1, -85.0 40.0 2)".
"""
ll, ur = box3d[6:-1].split(',')
@@ -342,7 +342,7 @@ def get_distance(self, f, dist_val, lookup_type):
This is the most complex implementation of the spatial backends due to
what is supported on geodetic geometry columns vs. what's available on
projected geometry columns. In addition, it has to take into account
- the newly introduced geography column type introudced in PostGIS 1.5.
+ the geography column type newly introduced in PostGIS 1.5.
"""
# Getting the distance parameter and any options.
if len(dist_val) == 1:
@@ -561,7 +561,7 @@ def spatial_aggregate_sql(self, agg):
"""
agg_name = agg.__class__.__name__
if not self.check_aggregate_support(agg):
- raise NotImplementedError('%s spatial aggregate is not implmented for this backend.' % agg_name)
+ raise NotImplementedError('%s spatial aggregate is not implemented for this backend.' % agg_name)
agg_name = agg_name.lower()
if agg_name == 'union':
agg_name += 'agg'
2  django/contrib/gis/db/backends/spatialite/creation.py
View
@@ -116,7 +116,7 @@ def load_spatialite_sql(self):
def spatialite_init_file(self):
# SPATIALITE_SQL may be placed in settings to tell GeoDjango
- # to use a specific path to the SpatiaLite initilization SQL.
+ # to use a specific path to the SpatiaLite initialization SQL.
return getattr(settings, 'SPATIALITE_SQL',
'init_spatialite-%s.%s.sql' %
self.connection.ops.spatial_version[:2])
4 django/contrib/gis/db/backends/spatialite/operations.py
View
@@ -233,7 +233,7 @@ def transform_value(value, srid):
placeholder = '%s(%%s, %s)' % (self.transform, f.srid)
else:
placeholder = '%s'
- # No geometry value used for F expression, substitue in
+ # No geometry value used for F expression, substitute in
# the column name instead.
return placeholder % self.get_expression_column(value)
else:
@@ -310,7 +310,7 @@ def spatial_aggregate_sql(self, agg):
"""
agg_name = agg.__class__.__name__
if not self.check_aggregate_support(agg):
- raise NotImplementedError('%s spatial aggregate is not implmented for this backend.' % agg_name)
+ raise NotImplementedError('%s spatial aggregate is not implemented for this backend.' % agg_name)
agg_name = agg_name.lower()
if agg_name == 'union':
agg_name += 'agg'
4 django/contrib/gis/db/models/query.py
View
@@ -73,7 +73,7 @@ def centroid(self, **kwargs):
def collect(self, **kwargs):
"""
Performs an aggregate collect operation on the given geometry field.
- This is analagous to a union operation, but much faster because
+ This is analogous to a union operation, but much faster because
boundaries are not dissolved.
"""
return self._spatial_aggregate(aggregates.Collect, **kwargs)
@@ -137,7 +137,7 @@ def force_rhr(self, **kwargs):
def geojson(self, precision=8, crs=False, bbox=False, **kwargs):
"""
- Returns a GeoJSON representation of the geomtry field in a `geojson`
+ Returns a GeoJSON representation of the geometry field in a `geojson`
attribute on each element of the GeoQuerySet.
The `crs` and `bbox` keywords may be set to True if the user wants
2  django/contrib/gis/db/models/sql/compiler.py
View
@@ -21,7 +21,7 @@ def get_columns(self, with_aliases=False):
If 'with_aliases' is true, any column names that are duplicated
(without the table names) are given unique aliases. This is needed in
- some cases to avoid ambiguitity with nested queries.
+ some cases to avoid ambiguity with nested queries.
This routine is overridden from Query to handle customized selection of
geometry columns.
2  django/contrib/gis/feeds.py
View
@@ -21,7 +21,7 @@ def georss_coords(self, coords):
def add_georss_point(self, handler, coords, w3c_geo=False):
"""
Adds a GeoRSS point with the given coords using the given handler.
- Handles the differences between simple GeoRSS and the more pouplar
+ Handles the differences between simple GeoRSS and the more popular
W3C Geo specification.
"""
if w3c_geo:
8 django/contrib/gis/gdal/prototypes/errcheck.py
View
@@ -12,7 +12,7 @@
# Helper routines for retrieving pointers and/or values from
# arguments passed in by reference.
def arg_byref(args, offset=-1):
- "Returns the pointer argument's by-refernece value."
+ "Returns the pointer argument's by-reference value."
return args[offset]._obj.value
@@ -56,8 +56,8 @@ def check_string(result, func, cargs, offset=-1, str_result=False):
ptr = ptr_byref(cargs, offset)
# Getting the string value
s = ptr.value
- # Correctly freeing the allocated memory beind GDAL pointer
- # w/the VSIFree routine.
+ # Correctly freeing the allocated memory behind GDAL pointer
+ # with the VSIFree routine.
if ptr:
lgdal.VSIFree(ptr)
return s
@@ -131,7 +131,7 @@ def check_str_arg(result, func, cargs):
"""
This is for the OSRGet[Angular|Linear]Units functions, which
require that the returned string pointer not be freed. This
- returns both the double and tring values.
+ returns both the double and string values.
"""
dbl = result
ptr = cargs[-1]._obj
2  django/contrib/gis/gdal/srs.py
View
@@ -120,7 +120,7 @@ def __getitem__(self, target):
0
>>> print(srs['UNIT|AUTHORITY']) # For the units authority, have to use the pipe symbole.
EPSG
- >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the untis
+ >>> print(srs['UNIT|AUTHORITY', 1]) # The authority value for the units
9122
"""
if isinstance(target, tuple):
2  django/contrib/gis/gdal/tests/test_envelope.py
View
@@ -20,7 +20,7 @@ def setUp(self):
self.e = Envelope(0, 0, 5, 5)
def test01_init(self):
- "Testing Envelope initilization."
+ "Testing Envelope initialization."
e1 = Envelope((0, 0, 5, 5))
Envelope(0, 0, 5, 5)
Envelope(0, '0', '5', 5) # Thanks to ww for this
2  django/contrib/gis/gdal/tests/test_geom.py
View
@@ -300,7 +300,7 @@ def test09a_srs(self):
self.assertEqual(4269, mpoly.srid)
self.assertEqual('NAD83', mpoly.srs.name)
- # Incrementing through the multipolyogn after the spatial reference
+ # Incrementing through the multipolygon after the spatial reference
# has been re-assigned.
for poly in mpoly:
self.assertEqual(mpoly.srs.wkt, poly.srs.wkt)
2  django/contrib/gis/geoip/base.py
View
@@ -192,7 +192,7 @@ def country_name(self, query):
def country(self, query):
"""
- Returns a dictonary with with the country code and name when given an
+ Returns a dictionary with with the country code and name when given an
IP address or a Fully Qualified Domain Name (FQDN). For example, both
'24.124.1.80' and 'djangoproject.com' are valid parameters.
"""
2  django/contrib/gis/geoip/prototypes.py
View
@@ -56,7 +56,7 @@ class GeoIPTag(Structure):
def check_record(result, func, cargs):
if result:
# Checking the pointer to the C structure, if valid pull out elements
- # into a dicionary.
+ # into a dictionary.
rec = result.contents
record = dict((fld, getattr(rec, fld)) for fld, ctype in rec._fields_)
4 django/contrib/gis/geos/geometry.py
View
@@ -78,7 +78,7 @@ def __init__(self, geo_input, srid=None):
else:
raise ValueError('String or unicode input unrecognized as WKT EWKT, and HEXEWKB.')
elif isinstance(geo_input, GEOM_PTR):
- # When the input is a pointer to a geomtry (GEOM_PTR).
+ # When the input is a pointer to a geometry (GEOM_PTR).
g = geo_input
elif isinstance(geo_input, memoryview):
# When the input is a buffer (WKB).
@@ -682,7 +682,7 @@ def extent(self):
def length(self):
"""
Returns the length of this Geometry (e.g., 0 for point, or the
- circumfrence of a Polygon).
+ circumference of a Polygon).
"""
return capi.geos_length(self.ptr, byref(c_double()))
4 django/contrib/gis/geos/libgeos.py
View
@@ -38,7 +38,7 @@
raise ImportError('Unsupported OS "%s"' % os.name)
# Using the ctypes `find_library` utility to find the path to the GEOS
-# shared library. This is better than manually specifiying each library name
+# shared library. This is better than manually specifying each library name
# and extension (e.g., libgeos_c.[so|so.1|dylib].).
if lib_names:
for lib_name in lib_names:
@@ -121,7 +121,7 @@ def get_pointer_arr(n):
return GeomArr()
# Returns the string version of the GEOS library. Have to set the restype
-# explicitly to c_char_p to ensure compatibility accross 32 and 64-bit platforms.
+# explicitly to c_char_p to ensure compatibility across 32 and 64-bit platforms.
geos_version = lgeos.GEOSversion
geos_version.argtypes = None
geos_version.restype = c_char_p
8 django/contrib/gis/geos/tests/test_geos.py
View
@@ -68,7 +68,7 @@ class FakeGeom2(GEOSBase):
# Because pointers have been set to NULL, an exception should be
# raised when we try to access it. Raising an exception is
- # preferrable to a segmentation fault that commonly occurs when
+ # preferable to a segmentation fault that commonly occurs when
# a C method is given a NULL memory reference.
for fg in (fg1, fg2):
# Equivalent to `fg.ptr`
@@ -167,7 +167,7 @@ def test_create_hex(self):
"Testing creation from HEX."
for g in self.geometries.hex_wkt:
geom_h = GEOSGeometry(g.hex)
- # we need to do this so decimal places get normalised
+ # we need to do this so decimal places get normalized
geom_t = fromstr(g.wkt)
self.assertEqual(geom_t.wkt, geom_h.wkt)
@@ -176,7 +176,7 @@ def test_create_wkb(self):
for g in self.geometries.hex_wkt:
wkb = memoryview(a2b_hex(g.hex.encode()))
geom_h = GEOSGeometry(wkb)
- # we need to do this so decimal places get normalised
+ # we need to do this so decimal places get normalized
geom_t = fromstr(g.wkt)
self.assertEqual(geom_t.wkt, geom_h.wkt)
@@ -788,7 +788,7 @@ def test_length(self):
ls = LineString((0, 0), (1, 1))
self.assertAlmostEqual(1.41421356237, ls.length, 11)
- # Should be circumfrence of Polygon
+ # Should be circumference of Polygon
poly = Polygon(LinearRing((0, 0), (0, 1), (1, 1), (1, 0), (0, 0)))
self.assertEqual(4.0, poly.length)
2  django/contrib/gis/maps/google/overlays.py
View
@@ -158,7 +158,7 @@ def __init__(self, geom, color='#0000ff', weight=2, opacity=1):
opacity:
The opacity of the polyline, between 0 and 1. Defaults to 1.
"""
- # If a GEOS geometry isn't passed in, try to contsruct one.
+ # If a GEOS geometry isn't passed in, try to construct one.
if isinstance(geom, six.string_types):
geom = fromstr(geom)
if isinstance(geom, (tuple, list)):
2  django/contrib/gis/measure.py
View
@@ -27,7 +27,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
"""
-Distance and Area objects to allow for sensible and convienient calculation
+Distance and Area objects to allow for sensible and convenient calculation
and conversions.
Authors: Robert Coup, Justin Bronn, Riccardo Di Virgilio
4 django/contrib/gis/static/gis/js/OLMapWidget.js
View
@@ -22,7 +22,7 @@ OpenLayers.Util.properFeatures = function(features, geom_type) {
/**
* Class: OpenLayers.Format.DjangoWKT
* Class for reading Well-Known Text, with workarounds to successfully parse
- * geometries and collections as returnes by django.contrib.gis.geos.
+ * geometries and collections as returned by django.contrib.gis.geos.
*
* Inherits from:
* - <OpenLayers.Format.WKT>
@@ -190,7 +190,7 @@ function MapWidget(options) {
scrollable: true
};
- // Altering using user-provied options
+ // Altering using user-provided options
for (var property in options) {
if (options.hasOwnProperty(property)) {
this.options[property] = options[property];
2  django/contrib/gis/tests/distapp/tests.py
View
@@ -24,7 +24,7 @@ class DistanceTest(TestCase):
if HAS_GEOS and HAS_SPATIAL_DB:
# A point we are testing distances with -- using a WGS84
- # coordinate that'll be implicitly transormed to that to
+ # coordinate that'll be implicitly transformed to that to
# the coordinate system of the field, EPSG:32140 (Texas South Central
# w/units in meters)
stx_pnt = GEOSGeometry('POINT (-95.370401017314293 29.704867409475465)', 4326)
4 django/contrib/gis/tests/geoapp/tests.py
View
@@ -345,7 +345,7 @@ def test_null_geometries(self):
nmi = State.objects.create(name='Northern Mariana Islands', poly=None)
self.assertEqual(nmi.poly, None)
- # Assigning a geomery and saving -- then UPDATE back to NULL.
+ # Assigning a geometry and saving -- then UPDATE back to NULL.
nmi.poly = 'POLYGON((0 0,1 0,1 1,1 0,0 0))'
nmi.save()
State.objects.filter(name='Northern Mariana Islands').update(poly=None)
@@ -359,7 +359,7 @@ def test_relate_lookup(self):
pnt1 = fromstr('POINT (649287.0363174 4177429.4494686)', srid=2847)
pnt2 = fromstr('POINT(-98.4919715741052 29.4333344025053)', srid=4326)
- # Not passing in a geometry as first param shoud
+ # Not passing in a geometry as first param should
# raise a type error when initializing the GeoQuerySet
self.assertRaises(ValueError, Country.objects.filter, mpoly__relate=(23, 'foo'))
2  django/contrib/gis/tests/inspectapp/tests.py
View
@@ -76,7 +76,7 @@ def test_date_field(self):
self.assertEqual(model_def, '\n'.join(expected))
def test_time_field(self):
- # Only possible to test this on PostGIS at the momemnt. MySQL
+ # Only possible to test this on PostGIS at the moment. MySQL
# complains about permissions, and SpatiaLite/Oracle are
# insanely difficult to get support compiled in for in GDAL.
if not connections['default'].ops.postgis:
2  django/contrib/gis/tests/maps/tests.py
View
@@ -28,7 +28,7 @@ def test_google_map_scripts(self):
@override_settings(GOOGLE_MAPS_API_KEY=GOOGLE_MAPS_API_KEY)
def test_unicode_in_google_maps(self):
"""
- Test that GoogleMap doesn't crash with non-ascii content.
+ Test that GoogleMap doesn't crash with non-ASCII content.
"""
from django.contrib.gis.geos import Point
from django.contrib.gis.maps.google.gmap import GoogleMap, GMarker
10 django/contrib/gis/tests/test_measure.py
View
@@ -1,5 +1,5 @@
"""
-Distance and Area objects to allow for sensible and convienient calculation
+Distance and Area objects to allow for sensible and convenient calculation
and conversions. Here are some tests.
"""
@@ -12,7 +12,7 @@ class DistanceTest(unittest.TestCase):
"Testing the Distance object"
def testInit(self):
- "Testing initialisation from valid units"
+ "Testing initialization from valid units"
d = Distance(m=100)
self.assertEqual(d.m, 100)
@@ -33,7 +33,7 @@ def testInit(self):
self.assertEqual(d.mm, 1000.0)
def testInitInvalid(self):
- "Testing initialisation from invalid units"
+ "Testing initialization from invalid units"
self.assertRaises(AttributeError, D, banana=100)
def testAccess(self):
@@ -149,7 +149,7 @@ class AreaTest(unittest.TestCase):
"Testing the Area object"
def testInit(self):
- "Testing initialisation from valid units"
+ "Testing initialization from valid units"
a = Area(sq_m=100)
self.assertEqual(a.sq_m, 100)
@@ -160,7 +160,7 @@ def testInit(self):
self.assertEqual(a.sq_m, 258998811.0336)
def testInitInvaliA(self):
- "Testing initialisation from invalid units"
+ "Testing initialization from invalid units"
self.assertRaises(AttributeError, A, banana=100)
def testAccess(self):
2  django/contrib/gis/utils/layermapping.py
View
@@ -489,7 +489,7 @@ def save(self, verbose=False, fid_range=False, step=False,
progress:
When this keyword is set, status information will be printed giving
- the number of features processed and sucessfully saved. By default,
+ the number of features processed and successfully saved. By default,
progress information will pe printed every 1000 features processed,
however, this default may be overridden by setting this keyword with an
integer for the desired interval.
2  django/core/files/uploadhandler.py
View
@@ -111,7 +111,7 @@ def receive_data_chunk(self, raw_data, start):
Receive data from the streamed upload parser. ``start`` is the position
in the file of the chunk.
"""
- raise NotImplementedError('subclasses of FileUploadHandler must provide a recieve_data_chunk() method')
+ raise NotImplementedError('subclasses of FileUploadHandler must provide a receive_data_chunk() method')
def file_complete(self, file_size):
"""
2  django/core/handlers/wsgi.py
View
@@ -162,7 +162,7 @@ def __call__(self, environ, start_response):
if self._request_middleware is None:
with self.initLock:
try:
- # Check that middleware is still uninitialised.
+ # Check that middleware is still uninitialized.
if self._request_middleware is None:
self.load_middleware()
except:
4 django/core/management/base.py
View
@@ -208,7 +208,7 @@ class BaseCommand(object):
def __init__(self):
self.style = color_style()
- # `requires_model_validation` is deprecated in favour of
+ # `requires_model_validation` is deprecated in favor of
# `requires_system_checks`. If both options are present, an error is
# raised. Otherwise the present option is used. If none of them is
# defined, the default value (True) is used.
@@ -218,7 +218,7 @@ def __init__(self):
if has_old_option:
warnings.warn(
'"requires_model_validation" is deprecated '
- 'in favour of "requires_system_checks".',
+ 'in favor of "requires_system_checks".',
PendingDeprecationWarning)
if has_old_option and has_new_option:
raise ImproperlyConfigured(
2  django/core/management/commands/inspectdb.py
View
@@ -96,7 +96,7 @@ def handle_inspection(self, options):
field_type = "ForeignKey('%s'" % rel_to
else:
# Calling `get_field_type` to get the field type string and any
- # additional paramters and notes.
+ # additional parameters and notes.
field_type, field_params, field_notes = self.get_field_type(connection, table_name, row)
extra_params.update(field_params)
comment_notes.extend(field_notes)
2  django/core/management/commands/migrate.py
View
@@ -224,7 +224,7 @@ def model_installed(model):
cursor.execute(statement)
tables.append(connection.introspection.table_name_converter(model._meta.db_table))
- # We force a commit here, as that was the previous behaviour.
+ # We force a commit here, as that was the previous behavior.
# If you can prove we don't need this, remove it.
transaction.set_dirty(using=connection.alias)
finally:
2  django/core/management/commands/validate.py
View
@@ -10,6 +10,6 @@ class Command(CheckCommand):
help = 'Deprecated. Use "check" command instead. ' + CheckCommand.help
def handle_noargs(self, **options):
- warnings.warn('"validate" has been deprecated in favour of "check".',
+ warnings.warn('"validate" has been deprecated in favor of "check".',
PendingDeprecationWarning)
super(Command, self).handle_noargs(**options)
2  django/core/management/templates.py
View
@@ -266,7 +266,7 @@ def cleanup_url(url):
guessed_filename += ext
# Move the temporary file to a filename that has better
- # chances of being recognnized by the archive utils
+ # chances of being recognized by the archive utils
if used_name != guessed_filename:
guessed_path = path.join(tempdir, guessed_filename)
shutil.move(the_path, guessed_path)
2  django/core/signing.py
View
@@ -10,7 +10,7 @@
URLsafe base64 encoded JSON of the object passed to dumps(). The second
component is a base64 encoded hmac/SHA1 hash of "$first_component:$secret"
-signing.loads(s) checks the signature and returns the deserialised object.
+signing.loads(s) checks the signature and returns the deserialized object.
If the signature fails, a BadSignature exception is raised.
>>> signing.loads("ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk")
4 django/db/backends/__init__.py
View
@@ -665,7 +665,7 @@ class BaseDatabaseFeatures(object):
# supported by the Python driver
supports_paramstyle_pyformat = True
- # Does the backend require literal defaults, rather than parameterised ones?
+ # Does the backend require literal defaults, rather than parameterized ones?
requires_literal_defaults = False
# Does the backend require a connection reset after each material schema change?
@@ -1387,7 +1387,7 @@ def runshell(self):
class BaseDatabaseValidation(object):
"""
- This class encapsualtes all backend-specific model validation.
+ This class encapsulates all backend-specific model validation.
"""
def __init__(self, connection):
self.connection = connection
4 django/db/backends/oracle/base.py
View
@@ -575,7 +575,7 @@ def init_connection_state(self):
# these are set in single statement it isn't clear what is supposed
# to happen.
cursor.execute("ALTER SESSION SET NLS_TERRITORY = 'AMERICA'")
- # Set oracle date to ansi date format. This only needs to execute
+ # Set Oracle date to ANSI date format. This only needs to execute
# once when we create a new connection. We also set the Territory
# to 'AMERICA' which forces Sunday to evaluate to a '1' in
# TO_CHAR().
@@ -730,7 +730,7 @@ def __init__(self, param, cursor, strings_only=False):
class VariableWrapper(object):
"""
An adapter class for cursor variables that prevents the wrapped object
- from being converted into a string when used to instanciate an OracleParam.
+ from being converted into a string when used to instantiate an OracleParam.
This can be used generally for any other object that should be passed into
Cursor.execute as-is.
"""
2  django/db/backends/schema.py
View
@@ -732,7 +732,7 @@ def alter_field(self, model, old_field, new_field, strict=False):
def _alter_column_type_sql(self, table, column, type):
"""
- Hook to specialise column type alteration for different backends,
+ Hook to specialize column type alteration for different backends,
for cases when a creation type is different to an alteration type
(e.g. SERIAL in PostgreSQL, PostGIS fields).
2  django/db/migrations/executor.py
View
@@ -124,7 +124,7 @@ def unapply_migration(self, migration, fake=False):
def detect_soft_applied(self, migration):
"""
- Tests whether a migration has been implicity applied - that the
+ Tests whether a migration has been implicitly applied - that the
tables it would create exist. This is intended only for use
on initial migrations (as it only looks for CreateModel).
"""
2  django/db/migrations/loader.py
View
@@ -23,7 +23,7 @@ class MigrationLoader(object):
an app. Their names are entirely unimportant from a code perspective,
but will probably follow the 1234_name.py convention.
- On initialisation, this class will scan those directories, and open and
+ On initialization, this class will scan those directories, and open and
read the python files, looking for a class called Migration, which should
inherit from django.db.migrations.Migration. See
django.db.migrations.migration for what that looks like.
2  django/db/migrations/migration.py
View
@@ -12,7 +12,7 @@ class Migration(object):
- replaces: A list of migration_names
Note that all migrations come out of migrations and into the Loader or
- Graph as instances, having been initialised with their app label and name.
+ Graph as instances, having been initialized with their app label and name.
"""
# Operations to apply during this migration, in order.
8 django/db/migrations/optimizer.py
View
@@ -7,8 +7,8 @@ class MigrationOptimizer(object):
and you are returned a list of equal or shorter length - operations
are merged into one if possible.
- For example, a CreateModel and an AddField can be optimised into a
- new CreateModel, and CreateModel and DeleteModel can be optimised into
+ For example, a CreateModel and an AddField can be optimized into a
+ new CreateModel, and CreateModel and DeleteModel can be optimized into
nothing.
"""
@@ -17,9 +17,9 @@ def optimize(self, operations, app_label=None):
Main optimization entry point. Pass in a list of Operation instances,
get out a new list of Operation instances.
- Unfortunately, due to the scope of the optimisation (two combinable
+ Unfortunately, due to the scope of the optimization (two combinable
operations might be separated by several hundred others), this can't be
- done as a peephole optimisation with checks/output implemented on
+ done as a peephole optimization with checks/output implemented on
the Operations themselves; instead, the optimizer looks at each
individual operation and scans forwards in the list to see if there
are any matches, stopping at boundaries - operations which can't
4 django/db/models/deletion.py
View
@@ -97,7 +97,7 @@ def add(self, objs, source=None, nullable=False, reverse_dependency=False):
def add_field_update(self, field, value, objs):
"""
- Schedules a field update. 'objs' must be a homogenous iterable
+ Schedules a field update. 'objs' must be a homogeneous iterable
collection of model instances (e.g. a QuerySet).
"""
if not objs:
@@ -148,7 +148,7 @@ def collect(self, objs, source=None, nullable=False, collect_related=True,
source_attr=None, reverse_dependency=False):
"""
Adds 'objs' to the collection of objects to be deleted as well as all
- parent instances. 'objs' must be a homogenous iterable collection of
+ parent instances. 'objs' must be a homogeneous iterable collection of
model instances (e.g. a QuerySet). If 'collect_related' is True,
related objects will be handled by their respective on_delete handler.
4 django/db/models/fields/__init__.py
View
@@ -64,7 +64,7 @@ class FieldDoesNotExist(Exception):
# A guide to Field parameters:
#
-# * name: The name of the field specifed in the model.
+# * name: The name of the field specified in the model.
# * attname: The attribute to use on the model object. This is the same as
# "name", except in the case of ForeignKeys, where "_id" is
# appended.
@@ -306,7 +306,7 @@ def deconstruct(self):
* top-level classes, top-level functions - will be referenced by their full import path
* Storage instances - these have their own deconstruct() method
- This is because the values here must be serialised into a text format
+ This is because the values here must be serialized into a text format
(possibly new Python code, possibly JSON) and these are the only types
with encoding handlers defined.
10 django/db/models/query.py
View
@@ -1287,14 +1287,14 @@ def get_klass_info(klass, max_depth=0, cur_depth=0, requested=None,
Helper function that recursively returns an information for a klass, to be
used in get_cached_row. It exists just to compute this information only
once for entire queryset. Otherwise it would be computed for each row, which
- leads to poor perfomance on large querysets.
+ leads to poor performance on large querysets.
Arguments:
* klass - the class to retrieve (and instantiate)
* max_depth - the maximum depth to which a select_related()
relationship should be explored.
* cur_depth - the current depth in the select_related() tree.
- Used in recursive calls to determin if we should dig deeper.
+ Used in recursive calls to determine if we should dig deeper.
* requested - A dictionary describing the select_related() tree
that is to be retrieved. keys are field names; values are
dictionaries describing the keys on that related object that
@@ -1359,7 +1359,7 @@ def get_klass_info(klass, max_depth=0, cur_depth=0, requested=None,
field_names = [f.attname for f in klass._meta.concrete_fields
if f.model in non_seen_models]
field_count = len(field_names)
- # Try to avoid populating field_names variable for perfomance reasons.
+ # Try to avoid populating field_names variable for performance reasons.
# If field_names variable is set, we use **kwargs based model init
# which is slower than normal init.
if field_count == len(klass._meta.concrete_fields):
@@ -1552,7 +1552,7 @@ def __iter__(self):
else:
model_cls = self.model
# All model's fields are present in the query. So, it is possible
- # to use *args based model instantation. For each field of the model,
+ # to use *args based model instantiation. For each field of the model,
# record the query column position matching that field.
model_init_field_pos = []
for field in self.model._meta.fields:
@@ -1762,7 +1762,7 @@ def prefetch_related_objects(result_cache, related_lookups):
# Descend down tree
- # We assume that objects retrieved are homogenous (which is the premise
+ # We assume that objects retrieved are homogeneous (which is the premise
# of prefetch_related), so what applies to first object applies to all.
first_obj = obj_list[0]
prefetcher, descriptor, attr_found, is_fetched = get_prefetcher(first_obj, through_attr)
2  django/db/models/query_utils.py
View
@@ -109,7 +109,7 @@ def __get__(self, instance, owner):
val = self._check_parent_chain(instance, name)
if val is None:
# We use only() instead of values() here because we want the
- # various data coersion methods (to_python(), etc.) to be
+ # various data coercion methods (to_python(), etc.) to be
# called here.
val = getattr(
non_deferred_model._base_manager.only(name).using(
2  django/db/models/related.py
View
@@ -26,7 +26,7 @@ def get_choices(self, include_blank=True, blank_choice=BLANK_CHOICE_DASH,
as SelectField choices for this field.
Analogue of django.db.models.fields.Field.get_choices, provided
- initially for utilisation by RelatedFieldListFilter.
+ initially for utilization by RelatedFieldListFilter.
"""
first_choice = blank_choice if include_blank else []
queryset = self.model._default_manager.all()
2  django/db/models/sql/compiler.py
View
@@ -890,7 +890,7 @@ def as_sql(self):
col = "%s.%s" % (qn(opts.db_table), qn(opts.pk.column))
result.append("VALUES (%s)" % ", ".join(placeholders[0]))
r_fmt, r_params = self.connection.ops.return_insert_id()
- # Skip empty r_fmt to allow subclasses to customize behaviour for
+ # Skip empty r_fmt to allow subclasses to customize behavior for
# 3rd party backends. Refs #19096.
if r_fmt:
result.append(r_fmt % col)
4 django/db/models/sql/query.py
View
@@ -568,7 +568,7 @@ def deferred_to_data(self, target, callback):
Converts the self.deferred_loading data structure to an alternate data
structure, describing the field that *will* be loaded. This is used to
compute the columns to select from the database and also by the
- QuerySet class to work out which fields are being initialised on each
+ QuerySet class to work out which fields are being initialized on each
model. Models that have all their fields included aren't mentioned in
the result, only those that have field restrictions in place.
@@ -1767,7 +1767,7 @@ def add_deferred_loading(self, field_names):
"""
# Fields on related models are stored in the literal double-underscore
# format, so that we can use a set datastructure. We do the foo__bar
- # splitting and handling when computing the SQL colum names (as part of
+ # splitting and handling when computing the SQL column names (as part of
# get_columns()).
existing, defer = self.deferred_loading
if defer:
2  django/db/transaction.py
View
@@ -426,7 +426,7 @@ def _transaction_func(entering, exiting, using):
"""
Takes 3 things, an entering function (what to do to start this block of
transaction management), an exiting function (what to do to end it, on both
- success and failure, and using which can be: None, indiciating using is
+ success and failure, and using which can be: None, indicating using is
DEFAULT_DB_ALIAS, a callable, indicating that using is DEFAULT_DB_ALIAS and
to return the function already wrapped.
2  django/dispatch/dispatcher.py
View
@@ -27,7 +27,7 @@ class Signal(object):
Internal attributes:
receivers
- { receriverkey (id) : weakref(receiver) }
+ { receiverkey (id) : weakref(receiver) }
"""
def __init__(self, providing_args=None, use_caching=False):
"""
2  django/forms/forms.py
View
@@ -190,7 +190,7 @@ def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_
for e in bf_errors])
hidden_fields.append(six.text_type(bf))
else:
- # Create a 'class="..."' atribute if the row should have any
+ # Create a 'class="..."' attribute if the row should have any
# CSS classes applied.
css_classes = bf.css_classes()
if css_classes:
2  django/forms/formsets.py
View
@@ -347,7 +347,7 @@ def clean(self):
"""
Hook for doing any extra formset-wide cleaning after Form.clean() has
been called on every form. Any ValidationError raised by this method
- will not be associated with a particular form; it will be accesible
+ will not be associated with a particular form; it will be accessible
via formset.non_form_errors()
"""
pass
6 django/http/multipartparser.py
View
@@ -253,7 +253,7 @@ def parse(self):
def handle_file_complete(self, old_field_name, counters):
"""
- Handle all the signalling that takes place when a file is complete.
+ Handle all the signaling that takes place when a file is complete.
"""
for i, handler in enumerate(self._upload_handlers):
file_obj = handler.file_complete(counters[i])
@@ -484,7 +484,7 @@ def __next__(self):
self._done = True
return chunk[:end]
else:
- # make sure we dont treat a partial boundary (and
+ # make sure we don't treat a partial boundary (and
# its separators) as data
if not chunk[:-rollback]: # and len(chunk) >= (len(self._boundary) + 6):
# There's nothing left, we should just return and mark as done.
@@ -498,7 +498,7 @@ def _find_boundary(self, data, eof=False):
"""
Finds a multipart boundary in data.
- Should no boundry exist in the data None is returned instead. Otherwise
+ Should no boundary exist in the data None is returned instead. Otherwise
a tuple containing the indices of the following are returned:
* the end of current encapsulation
4 django/http/response.py
View
@@ -189,7 +189,7 @@ def __getitem__(self, header):
return self._headers[header.lower()][1]
def __getstate__(self):
- # SimpleCookie is not pickeable with pickle.HIGHEST_PROTOCOL, so we
+ # SimpleCookie is not pickleable with pickle.HIGHEST_PROTOCOL, so we
# serialize to a string instead
state = self.__dict__.copy()
state['cookies'] = str(state['cookies'])
@@ -274,7 +274,7 @@ def make_bytes(self, value):
return bytes(value)
# Handle string types -- we can't rely on force_bytes here because:
- # - under Python 3 it attemps str conversion first
+ # - under Python 3 it attempts str conversion first
# - when self._charset != 'utf-8' it re-encodes the content
if isinstance(value, bytes):
return bytes(value)
2  django/template/base.py
View
@@ -69,7 +69,7 @@
builtins = []
# True if TEMPLATE_STRING_IF_INVALID contains a format string (%s). None means
-# uninitialised.
+# uninitialized.
invalid_var_format_string = None
4 django/template/defaulttags.py
View
@@ -567,7 +567,7 @@ def cycle(parser, token, escape=False):
{% endfor %}
Outside of a loop, give the values a unique name the first time you call
- it, then use that name each sucessive time through::
+ it, then use that name each successive time through::
<tr class="{% cycle 'row1' 'row2' 'row3' as rowcolors %}">...</tr>
<tr class="{% cycle rowcolors %}">...</tr>
@@ -944,7 +944,7 @@ def do_if(parser, token):
{% endif %}
{% if athlete_list and coach_list %}
- Both atheletes and coaches are available.
+ Both athletes and coaches are available.
{% endif %}
{% if not athlete_list or coach_list %}
2  django/test/_doctest.py
View
@@ -2253,7 +2253,7 @@ def debug(self):
caller can catch the errors and initiate post-mortem debugging.
The DocTestCase provides a debug method that raises
- UnexpectedException errors if there is an unexepcted
+ UnexpectedException errors if there is an unexpected
exception:
>>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
2  django/test/signals.py
View
@@ -122,7 +122,7 @@ def complex_setting_changed(**kwargs):
if kwargs['enter'] and kwargs['setting'] in COMPLEX_OVERRIDE_SETTINGS:
# Considering the current implementation of the signals framework,
# stacklevel=5 shows the line containing the override_settings call.
- warnings.warn("Overriding setting %s can lead to unexpected behaviour."
+ warnings.warn("Overriding setting %s can lead to unexpected behavior."
% kwargs['setting'], stacklevel=5)
2  django/test/testcases.py
View
@@ -1182,7 +1182,7 @@ def _tearDownClassInternal(cls):
cls.server_thread.terminate()
cls.server_thread.join()
- # Restore sqlite connections' non-sharability
+ # Restore sqlite connections' non-shareability
for conn in connections.all():
if (conn.vendor == 'sqlite'
and conn.settings_dict['NAME'] == ':memory:'):
2  django/test/utils.py
View
@@ -259,7 +259,7 @@ class modify_settings(override_settings):
"""
def __init__(self, *args, **kwargs):
if args:
- # Hack used when instaciating from SimpleTestCase._pre_setup.
+ # Hack used when instantiating from SimpleTestCase._pre_setup.
assert not kwargs
self.operations = args[0]
else:
2  django/utils/functional.py
View
@@ -282,7 +282,7 @@ def _setup(self):
class SimpleLazyObject(LazyObject):
"""
- A lazy object initialised from any function.
+ A lazy object initialized from any function.
Designed for compound objects of unknown type. For builtins or objects of
known type, use django.utils.functional.lazy.
10 django/utils/html.py
View
@@ -213,13 +213,13 @@ def urlize(text, trim_url_limit=None, nofollow=False, autoescape=False):
Links can have trailing punctuation (periods, commas, close-parens) and
leading punctuation (opening parens) and it'll still do the right thing.
- If trim_url_limit is not None, the URLs in link text longer than this limit
- will truncated to trim_url_limit-3 characters and appended with an elipsis.
+ If trim_url_limit is not None, the URLs in the link text longer than this
+ limit will be truncated to trim_url_limit-3 characters and appended with
+ an ellipsis.
- If nofollow is True, the URLs in link text will get a rel="nofollow"
- attribute.
+ If nofollow is True, the links will get a rel="nofollow" attribute.
- If autoescape is True, the link text and URLs will get autoescaped.
+ If autoescape is True, the link text and URLs will be autoescaped.
"""
def trim_url(x, limit=trim_url_limit):
if limit is None or len(x) <= limit:
2  django/utils/ipv6.py
View
@@ -14,7 +14,7 @@ def clean_ipv6_address(ip_str, unpack_ipv4=False,
Validity is checked by calling is_valid_ipv6_address() - if an
invalid address is passed, ValidationError is raised.
- Replaces the longest continious zero-sequence with "::" and
+ Replaces the longest continuous zero-sequence with "::" and
removes leading zeroes and makes sure all hextets are lowercase.
Args:
2  django/utils/jslex.py
View
@@ -82,7 +82,7 @@ class JsLexer(Lexer):
>>> list(lexer.lex("a = 1"))
[('id', 'a'), ('ws', ' '), ('punct', '='), ('ws', ' '), ('dnum', '1')]
- This doesn't properly handle non-Ascii characters in the Javascript source.
+ This doesn't properly handle non-ASCII characters in the Javascript source.
"""
# Because these tokens are matched as alternatives in a regex, longer
2  django/utils/regex_helper.py
View
@@ -169,7 +169,7 @@ def normalize(pattern):
count, ch = get_quantifier(ch, pattern_iter)
if ch:
# We had to look ahead, but it wasn't need to compute the
- # quanitifer, so use this character next time around the
+ # quantifier, so use this character next time around the
# main loop.
consume_next = False
2  django/utils/six.py
View
@@ -641,7 +641,7 @@ def wrapper(cls):
else:
_assertRaisesRegex = "assertRaisesRegexp"
_assertRegex = "assertRegexpMatches"
- # memoryview and buffer are not stricly equivalent, but should be fine for
+ # memoryview and buffer are not strictly equivalent, but should be fine for
# django core usage (mainly BinaryField). However, Jython doesn't support
# buffer (see http://bugs.jython.org/issue1521), so we have to be careful.
if sys.platform.startswith('java'):
8 tests/admin_changelist/tests.py
View
@@ -191,7 +191,7 @@ def test_custom_paginator(self):
def test_distinct_for_m2m_in_list_filter(self):
"""
Regression test for #13902: When using a ManyToMany in list_filter,
- results shouldn't apper more than once. Basic ManyToMany.
+ results shouldn't appear more than once. Basic ManyToMany.
"""
blues = Genre.objects.create(name='Blues')
band = Band.objects.create(name='B.B. King Review', nr_of_members=11)
@@ -215,7 +215,7 @@ def test_distinct_for_m2m_in_list_filter(self):
def test_distinct_for_through_m2m_in_list_filter(self):
"""
Regression test for #13902: When using a ManyToMany in list_filter,
- results shouldn't apper more than once. With an intermediate model.
+ results shouldn't appear more than once. With an intermediate model.
"""
lead = Musician.objects.create(name='Vox')
band = Group.objects.create(name='The Hype')
@@ -238,7 +238,7 @@ def test_distinct_for_through_m2m_in_list_filter(self):
def test_distinct_for_inherited_m2m_in_list_filter(self):
"""
Regression test for #13902: When using a ManyToMany in list_filter,
- results shouldn't apper more than once. Model managed in the
+ results shouldn't appear more than once. Model managed in the
admin inherits from the one that defins the relationship.
"""
lead = Musician.objects.create(name='John')
@@ -262,7 +262,7 @@ def test_distinct_for_inherited_m2m_in_list_filter(self):
def test_distinct_for_m2m_to_inherited_in_list_filter(self):
"""
Regression test for #13902: When using a ManyToMany in list_filter,
- results shouldn't apper more than once. Target of the relationship
+ results shouldn't appear more than once. Target of the relationship
inherits from another.
"""
lead = ChordsMusician.objects.create(name='Player A')
6 tests/admin_inlines/tests.py
View
@@ -63,7 +63,7 @@ def test_many_to_many_inlines(self):
def test_inline_primary(self):
person = Person.objects.create(firstname='Imelda')
item = OutfitItem.objects.create(name='Shoes')
- # Imelda likes shoes, but can't cary her own bags.
+ # Imelda likes shoes, but can't carry her own bags.
data = {
'shoppingweakness_set-TOTAL_FORMS': 1,
'shoppingweakness_set-INITIAL_FORMS': 0,
@@ -91,7 +91,7 @@ def test_tabular_non_field_errors(self):
'title_set-0-title2': 'a different title',
}
response = self.client.post('/admin/admin_inlines/titlecollection/add/', data)
- # Here colspan is "4": two fields (title1 and title2), one hidden field and the delete checkbock.
+ # Here colspan is "4": two fields (title1 and title2), one hidden field and the delete checkbox.
self.assertContains(response, '<tr><td colspan="4"><ul class="errorlist"><li>The two titles must be the same</li></ul></td></tr>')
def test_no_parent_callable_lookup(self):
@@ -109,7 +109,7 @@ def test_callable_lookup(self):
self.assertEqual(response.status_code, 200)
# Add parent object view should have the child inlines section
self.assertContains(response, '<div class="inline-group" id="question_set-group">')
- # The right callabe should be used for the inline readonly_fields
+ # The right callable should be used for the inline readonly_fields
# column cells
self.assertContains(response, '<p>Callable in QuestionInline</p>')
2  tests/admin_ordering/tests.py
View
@@ -58,7 +58,7 @@ class BandAdmin(ModelAdmin):
def test_dynamic_ordering(self):
"""
- Let's use a custom ModelAdmin that changes the ordering dinamically.
+ Let's use a custom ModelAdmin that changes the ordering dynamically.
"""
super_user = User.objects.create(username='admin', is_superuser=True)
other_user = User.objects.create(username='other')
4 tests/admin_scripts/tests.py
View
@@ -2,7 +2,7 @@
from __future__ import unicode_literals
"""
-A series of tests to establish that the command-line managment tools work as
+A series of tests to establish that the command-line management tools work as
advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE
and default settings.py files.
"""
@@ -1474,7 +1474,7 @@ def raise_command_error(*args, **kwargs):
def test_run_from_argv_non_ascii_error(self):
"""
- Test that non-ascii message of CommandError does not raise any
+ Test that non-ASCII message of CommandError does not raise any
UnicodeDecodeError in run_from_argv.
"""
def raise_command_error(*args, **kwargs):
28 tests/admin_views/tests.py
View
@@ -249,7 +249,7 @@ def testChangeListSortingCallable(self):
def testChangeListSortingModel(self):
"""
Ensure we can sort on a list_display field that is a Model method
- (colunn 3 is 'model_year' in ArticleAdmin)
+ (column 3 is 'model_year' in ArticleAdmin)
"""
response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit, {'o': '-3'})
self.assertContentBefore(response, 'Newest content', 'Middle content',
@@ -729,7 +729,7 @@ def test_extended_bodyclass_template_delete_selected_confirmation(self):
group = Group.objects.create(name="foogroup")
post_data = {
'action': 'delete_selected',
- 'selected_accross': '0',
+ 'selected_across': '0',
'index': '0',
'_selected_action': group.id
}
@@ -1185,7 +1185,7 @@ def testChangeView(self):
'date_0': '2008-03-18', 'date_1': '10:54:39',
'section': 1}
- # add user shoud not be able to view the list of article or change any of them
+ # add user should not be able to view the list of article or change any of them
self.client.get('/test_admin/admin/')
self.client.post(login_url, self.adduser_login)
response = self.client.get('/test_admin/admin/admin_views/article/')
@@ -1259,7 +1259,7 @@ def testHistoryView(self):
login_url = reverse('admin:login') + '?next=/test_admin/admin/'
- # add user shoud not be able to view the list of article or change any of them
+ # add user should not be able to view the list of article or change any of them
self.client.get('/test_admin/admin/')
self.client.post(login_url, self.adduser_login)
response = self.client.get('/test_admin/admin/admin_views/article/1/history/')
@@ -1366,7 +1366,7 @@ def testDeleteView(self):
login_url = reverse('admin:login') + '?next=/test_admin/admin/'
delete_dict = {'post': 'yes'}
- # add user shoud not be able to delete articles
+ # add user should not be able to delete articles
self.client.get('/test_admin/admin/')
self.client.post(login_url, self.adduser_login)
response = self.client.get('/test_admin/admin/admin_views/article/1/delete/')
@@ -1749,7 +1749,7 @@ def test_change_view_history_link(self):
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class SecureViewTests(TestCase):
"""
- Test behaviour of a view protected by the staff_member_required decorator.
+ Test behavior of a view protected by the staff_member_required decorator.
"""
urls = "admin_views.urls"
fixtures = ['admin-views-users.xml']
@@ -1782,7 +1782,7 @@ def tearDown(self):
def testUnicodeEdit(self):
"""
- A test to ensure that POST on edit_view handles non-ascii characters.
+ A test to ensure that POST on edit_view handles non-ASCII characters.
"""
post_data = {
"name": "Test lærdommer",
@@ -1815,7 +1815,7 @@ def testUnicodeEdit(self):
def testUnicodeDelete(self):
"""
- Ensure that the delete_view handles non-ascii characters
+ Ensure that the delete_view handles non-ASCII characters
"""
delete_dict = {'post': 'yes'}
response = self.client.get('/test_admin/admin/admin_views/book/1/delete/')
@@ -3995,7 +3995,7 @@ def test_index_css_classes(self):
def testAppModelInFormBodyClass(self):
"""
- Ensure app and model tag are correcly read by change_form template
+ Ensure app and model tag are correctly read by change_form template
"""
response = self.client.get('/test_admin/admin/admin_views/section/add/')
self.assertEqual(response.status_code, 200)
@@ -4004,7 +4004,7 @@ def testAppModelInFormBodyClass(self):
def testAppModelInListBodyClass(self):
"""
- Ensure app and model tag are correcly read by change_list template
+ Ensure app and model tag are correctly read by change_list template
"""
response = self.client.get('/test_admin/admin/admin_views/section/')
self.assertEqual(response.status_code, 200)
@@ -4013,7 +4013,7 @@ def testAppModelInListBodyClass(self):
def testAppModelInDeleteConfirmationBodyClass(self):
"""
- Ensure app and model tag are correcly read by delete_confirmation
+ Ensure app and model tag are correctly read by delete_confirmation
template
"""
response = self.client.get(
@@ -4024,7 +4024,7 @@ def testAppModelInDeleteConfirmationBodyClass(self):
def testAppModelInAppIndexBodyClass(self):
"""
- Ensure app and model tag are correcly read by app_index template
+ Ensure app and model tag are correctly read by app_index template
"""
response = self.client.get('/test_admin/admin/admin_views/')
self.assertEqual(response.status_code, 200)
@@ -4032,7 +4032,7 @@ def testAppModelInAppIndexBodyClass(self):
def testAppModelInDeleteSelectedConfirmationBodyClass(self):
"""
- Ensure app and model tag are correcly read by
+ Ensure app and model tag are correctly read by
delete_selected_confirmation template
"""
action_data = {
@@ -4719,7 +4719,7 @@ def test_false(self):
)
def test_true(self):
- "Ensure that the default behaviour is followed if view_on_site is True"
+ "Ensure that the default behavior is followed if view_on_site is True"
response = self.client.get('/test_admin/admin/admin_views/city/1/')
content_type_pk = ContentType.objects.get_for_model(City).pk
self.assertContains(response,
4 tests/aggregation_regress/tests.py
View
@@ -70,7 +70,7 @@ def test_annotate_with_extra(self):
Regression test for #11916: Extra params + aggregation creates
incorrect SQL.
"""
- # oracle doesn't support subqueries in group by clause
+ # Oracle doesn't support subqueries in group by clause
shortest_book_sql = """
SELECT name
FROM aggregation_regress_book b
@@ -1080,7 +1080,7 @@ def test_name_filters(self):
)
def test_name_expressions(self):
- # Test that aggregates are spotted corretly from F objects.
+ # Test that aggregates are spotted correctly from F objects.
# Note that Adrian's age is 34 in the fixtures, and he has one book
# so both conditions match one author.
qs = Author.objects.annotate(Count('book')).filter(
10 tests/backends/tests.py
View
@@ -563,14 +563,14 @@ def test_cursor_executemany_with_iterator(self):
@skipUnlessDBFeature('supports_paramstyle_pyformat')
def test_cursor_execute_with_pyformat(self):
- #10070: Support pyformat style passing of paramters
+ #10070: Support pyformat style passing of parameters
args = {'root': 3, 'square': 9}
self.create_squares(args, 'pyformat', multiple=False)
self.assertEqual(models.Square.objects.count(), 1)
@skipUnlessDBFeature('supports_paramstyle_pyformat')
def test_cursor_executemany_with_pyformat(self):
- #10070: Support pyformat style passing of paramters
+ #10070: Support pyformat style passing of parameters
args = [{'root': i, 'square': i ** 2} for i in range(-5, 6)]
self.create_squares(args, 'pyformat', multiple=True)
self.assertEqual(models.Square.objects.count(), 11)
@@ -733,7 +733,7 @@ def test_disable_constraint_checks_manually(self):
with transaction.atomic():
# Create an Article.
models.Article.objects.create(headline="Test article", pub_date=datetime.datetime(2010, 9, 4), reporter=self.r)
- # Retrive it from the DB
+ # Retrieve it from the DB
a = models.Article.objects.get(headline="Test article")
a.reporter_id = 30
try:
@@ -751,7 +751,7 @@ def test_disable_constraint_checks_context_manager(self):
with transaction.atomic():
# Create an Article.
models.Article.objects.create(headline="Test article", pub_date=datetime.datetime(2010, 9, 4), reporter=self.r)
- # Retrive it from the DB
+ # Retrieve it from the DB
a = models.Article.objects.get(headline="Test article")
a.reporter_id = 30
try:
@@ -768,7 +768,7 @@ def test_check_constraints(self):
with transaction.atomic():
# Create an Article.
models.Article.objects.create(headline="Test article", pub_date=datetime.datetime(2010, 9, 4), reporter=self.r)
- # Retrive it from the DB
+ # Retrieve it from the DB
a = models.Article.objects.get(headline="Test article")
a.reporter_id = 30
with connection.constraint_checks_disabled():
2  tests/basic/tests.py
View
@@ -871,7 +871,7 @@ def get_queryset(self):
with self.assertNumQueries(2):
asos.save()
self.assertTrue(FakeQuerySet.called)
- # This is not wanted behaviour, but this is how Django has always
+ # This is not wanted behavior, but this is how Django has always
# behaved for databases that do not return correct information
# about matched rows for UPDATE.
with self.assertRaises(DatabaseError):
2  tests/cache/tests.py
View
@@ -1292,7 +1292,7 @@ def test_get_cache_key_with_query(self):
def test_cache_key_varies_by_url(self):
"""
- get_cache_key keys differ by fully-qualfied URL instead of path
+ get_cache_key keys differ by fully-qualified URL instead of path
"""
request1 = self.factory.get(self.path, HTTP_HOST='sub-1.example.com')
learn_cache_key(request1, HttpResponse())
2  tests/defer/tests.py
View
@@ -110,7 +110,7 @@ def test_defer(self):
obj.name = "c2"
obj.save()
- # You can retrive a single column on a base class with no fields
+ # You can retrieve a single column on a base class with no fields
obj = Child.objects.only("name").get(name="c2")
self.assert_delayed(obj, 3)
self.assertEqual(obj.name, "c2")
2  tests/extra_regress/tests.py
View
@@ -131,7 +131,7 @@ def test_regression_8039(self):
"""
Regression test for #8039: Ordering sometimes removed relevant tables
from extra(). This test is the critical case: ordering uses a table,
- but then removes the reference because of an optimisation. The table
+ but then removes the reference because of an optimization. The table
should still be present because of the extra() call.
"""
self.assertQuerysetEqual(
2  tests/field_subclassing/fields.py
View
@@ -59,7 +59,7 @@ class SmallerField(SmallField):
class JSONField(six.with_metaclass(models.SubfieldBase, models.TextField)):
- description = ("JSONField automatically serializes and desializes values to "
+ description = ("JSONField automatically serializes and deserializes values to "
"and from JSON.")
def to_python(self, value):
4 tests/field_subclassing/tests.py
View
@@ -39,7 +39,7 @@ def test_custom_field(self):
# Custom fields still have normal field's attributes.
self.assertEqual(m._meta.get_field("data").verbose_name, "small field")
- # The m.data attribute has been initialised correctly. It's a Small
+ # The m.data attribute has been initialized correctly. It's a Small
# object.
self.assertEqual((m.data.first, m.data.second), (1, 2))
@@ -100,7 +100,7 @@ def test_subfieldbase_plays_nice_with_module_inspect(self):
http://users.rcn.com/python/download/Descriptor.htm#properties
"""
# Even when looking for totally different properties, SubfieldBase's
- # non property like behaviour made inspect crash. Refs #12568.
+ # non property like behavior made inspect crash. Refs #12568.
data = dict(inspect.getmembers(MyModel))
self.assertIn('__module__', data)
self.assertEqual(data['__module__'], 'field_subclassing.models')
2  tests/file_storage/tests.py
View
@@ -341,7 +341,7 @@ def fake_remove(path):
def test_file_chunks_error(self):
"""
- Test behaviour when file.chunks() is raising an error
+ Test behavior when file.chunks() is raising an error
"""
f1 = ContentFile('chunks fails')
2  tests/fixtures/tests.py
View
@@ -304,7 +304,7 @@ def test_compressed_loading(self):
])
def test_ambiguous_compressed_fixture(self):
- # The name "fixture5" is ambigous, so loading it will raise an error
+ # The name "fixture5" is ambiguous, so loading it will raise an error
with self.assertRaises(management.CommandError) as cm:
management.call_command('loaddata', 'fixture5', verbosity=0)
self.assertIn("Multiple fixtures named 'fixture5'", cm.exception.args[0])
6 tests/fixtures_regress/tests.py
View
@@ -64,7 +64,7 @@ def test_duplicate_pk(self):
def test_loaddata_not_found_fields_not_ignore(self):
"""
Test for ticket #9279 -- Error is raised for entries in
- the serialised data for fields that have been removed
+ the serialized data for fields that have been removed
from the database when not ignored.
"""
with self.assertRaises(DeserializationError):
@@ -77,7 +77,7 @@ def test_loaddata_not_found_fields_not_ignore(self):
def test_loaddata_not_found_fields_ignore(self):
"""
Test for ticket #9279 -- Ignores entries in
- the serialised data for fields that have been removed
+ the serialized data for fields that have been removed
from the database.
"""
management.call_command(
@@ -90,7 +90,7 @@ def test_loaddata_not_found_fields_ignore(self):
def test_loaddata_not_found_fields_ignore_xml(self):
"""
- Test for ticket #19998 -- Ignore entries in the XML serialised data
+ Test for ticket #19998 -- Ignore entries in the XML serialized data
for fields that have been removed from the model definition.
"""
management.call_command(
2  tests/foreign_object/models.py