summaryrefslogtreecommitdiff
path: root/django/db/models/query_utils.py
diff options
context:
space:
mode:
authorAnton Samarchyan <anton.samarchyan@savoirfairelinux.com>2017-01-24 18:04:12 -0500
committerTim Graham <timograham@gmail.com>2017-02-28 09:17:27 -0500
commit60e52a047e55bc4cd5a93a8bd4d07baed27e9a22 (patch)
tree010a363968b1ed41adf2e64c98d572d7148a2a5e /django/db/models/query_utils.py
parentd6e26e5b7c8063c2cc5aa045edea6555bf358fc2 (diff)
downloaddjango-60e52a047e55bc4cd5a93a8bd4d07baed27e9a22.tar.gz
Refs #27656 -- Updated django.db docstring verbs according to PEP 257.
Diffstat (limited to 'django/db/models/query_utils.py')
-rw-r--r--django/db/models/query_utils.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py
index fe1d8f9f69..27430ae4ca 100644
--- a/django/db/models/query_utils.py
+++ b/django/db/models/query_utils.py
@@ -19,9 +19,7 @@ PathInfo = namedtuple('PathInfo', 'from_opts to_opts target_fields join_field m2
class InvalidQuery(Exception):
- """
- The query passed to raw isn't a safe query to use with raw.
- """
+ """The query passed to raw() isn't a safe query to use with raw()."""
pass
@@ -47,7 +45,7 @@ class QueryWrapper:
class Q(tree.Node):
"""
- Encapsulates filters as objects that can then be combined logically (using
+ Encapsulate filters as objects that can then be combined logically (using
`&` and `|`).
"""
# Connection types
@@ -112,8 +110,8 @@ class DeferredAttribute:
def __get__(self, instance, cls=None):
"""
- Retrieves and caches the value from the datastore on the first lookup.
- Returns the cached value.
+ Retrieve and caches the value from the datastore on the first lookup.
+ Return the cached value.
"""
if instance is None:
return self
@@ -211,7 +209,7 @@ class RegisterLookupMixin:
def select_related_descend(field, restricted, requested, load_fields, reverse=False):
"""
- Returns True if this field should be used to descend deeper for
+ Return True if this field should be used to descend deeper for
select_related() purposes. Used by both the query construction code
(sql.query.fill_related_selections()) and the model instance creation code
(query.get_klass_info()).
@@ -247,10 +245,9 @@ def select_related_descend(field, restricted, requested, load_fields, reverse=Fa
def refs_expression(lookup_parts, annotations):
"""
- A helper method to check if the lookup_parts contains references
- to the given annotations set. Because the LOOKUP_SEP is contained in the
- default annotation names we must check each prefix of the lookup_parts
- for a match.
+ Check if the lookup_parts contains references to the given annotations set.
+ Because the LOOKUP_SEP is contained in the default annotation names, check
+ each prefix of the lookup_parts for a match.
"""
for n in range(len(lookup_parts) + 1):
level_n_lookup = LOOKUP_SEP.join(lookup_parts[0:n])