Skip to content

Commit 7d19ba9

Browse files
authored
docs: Fix a few typos (#433)
There are small typos in: - cacheops/query.py - cacheops/utils.py - tests/tests.py - tests/utils.py Fixes: - Should read `superclasses` rather than `superclassses`. - Should read `querying` rather than `quering`. - Should read `overridden` rather than `overriden`. - Should read `omitting` rather than `omiting`. - Should read `differently` rather than `diffrently`. - Should read `different` rather than `diffrent`. - Should read `destroy` rather than `destory`.
1 parent 3261ded commit 7d19ba9

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

cacheops/query.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def _cache_key(self, prefix=True):
183183
# If query results differ depending on database
184184
if self._cacheprofile and not self._cacheprofile['db_agnostic']:
185185
md.update(self.db)
186-
# Iterable class pack results diffrently
186+
# Iterable class pack results differently
187187
it_class = self._iterable_class
188188
md.update('%s.%s' % (it_class.__module__, it_class.__name__))
189189

@@ -217,7 +217,7 @@ def cache(self, ops=None, timeout=None, lock=None):
217217
timeout - override default cache timeout
218218
lock - use lock to prevent dog-pile effect
219219
220-
NOTE: you actually can disable caching by omiting corresponding ops,
220+
NOTE: you actually can disable caching by omitting corresponding ops,
221221
.cache(ops=[]) disables caching for this queryset.
222222
"""
223223
self._require_cacheprofile()
@@ -287,7 +287,7 @@ def _fetch_all(self):
287287

288288
def count(self):
289289
if self._should_cache('count'):
290-
# Optmization borrowed from overriden method:
290+
# Optmization borrowed from overridden method:
291291
# if queryset cache is already filled just return its len
292292
if self._result_cache is not None:
293293
return len(self._result_cache)
@@ -331,7 +331,7 @@ def get(self, *args, **kwargs):
331331
and not self.query.select_related \
332332
and not self.query.where.children:
333333
# NOTE: We use simpler way to generate a cache key to cut costs.
334-
# Some day it could produce same key for diffrent requests.
334+
# Some day it could produce same key for different requests.
335335
key = (self.__class__, self.model) + tuple(sorted(kwargs.items()))
336336
try:
337337
return _local_get_cache[key]

cacheops/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def get_concrete_model(model):
1515

1616
def model_family(model):
1717
"""
18-
Returns a list of all proxy models, including subclasess, superclassses and siblings.
18+
Returns a list of all proxy models, including subclasess, superclasses and siblings.
1919
"""
2020
def class_tree(cls):
2121
return [cls] + lmapcat(class_tree, cls.__subclasses__())

tests/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def test_159(self):
485485
brand.labels.add(label)
486486

487487
# Create another brand with the same pk as label.
488-
# This will trigger a bug invalidating brands quering them by label id.
488+
# This will trigger a bug invalidating brands querying them by label id.
489489
another_brand = Brand.objects.create(pk=2)
490490

491491
list(brand.labels.cache())

tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def run(self):
4848
self._exc = e
4949
finally:
5050
# Django does not drop postgres connections opened in new threads.
51-
# This leads to postgres complaining about db accessed when we try to destory it.
51+
# This leads to postgres complaining about db accessed when we try to destroy it.
5252
# See https://code.djangoproject.com/ticket/22420#comment:18
5353
from django.db import connection
5454
connection.close()

0 commit comments

Comments
 (0)