diff options
| author | Anton Samarchyan <anton.samarchyan@savoirfairelinux.com> | 2017-01-24 18:04:12 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-02-28 09:17:27 -0500 |
| commit | 60e52a047e55bc4cd5a93a8bd4d07baed27e9a22 (patch) | |
| tree | 010a363968b1ed41adf2e64c98d572d7148a2a5e /django/db/models/sql/subqueries.py | |
| parent | d6e26e5b7c8063c2cc5aa045edea6555bf358fc2 (diff) | |
Refs #27656 -- Updated django.db docstring verbs according to PEP 257.
Diffstat (limited to 'django/db/models/sql/subqueries.py')
| -rw-r--r-- | django/db/models/sql/subqueries.py | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/django/db/models/sql/subqueries.py b/django/db/models/sql/subqueries.py index 03a5155b9b..65e944baa9 100644 --- a/django/db/models/sql/subqueries.py +++ b/django/db/models/sql/subqueries.py @@ -14,10 +14,7 @@ __all__ = ['DeleteQuery', 'UpdateQuery', 'InsertQuery', 'AggregateQuery'] class DeleteQuery(Query): - """ - Delete queries are done through this class, since they are more constrained - than general queries. - """ + """A DELETE SQL query.""" compiler = 'SQLDeleteCompiler' @@ -81,9 +78,7 @@ class DeleteQuery(Query): class UpdateQuery(Query): - """ - Represents an "update" SQL query. - """ + """An UPDATE SQL query.""" compiler = 'SQLUpdateCompiler' @@ -93,7 +88,7 @@ class UpdateQuery(Query): def _setup_query(self): """ - Runs on initialization and after cloning. Any attributes that would + Run on initialization and after cloning. Any attributes that would normally be set in __init__ should go in here, instead, so that they are also set up after a clone() call. """ @@ -148,15 +143,15 @@ class UpdateQuery(Query): def add_related_update(self, model, field, value): """ - Adds (name, value) to an update query for an ancestor model. + Add (name, value) to an update query for an ancestor model. - Updates are coalesced so that we only run one update query per ancestor. + Update are coalesced so that only one update query per ancestor is run. """ self.related_updates.setdefault(model, []).append((field, None, value)) def get_related_updates(self): """ - Returns a list of query objects: one for each update required to an + Return a list of query objects: one for each update required to an ancestor model. Each query will have the same filtering conditions as the current query but will only update a single table. """ @@ -181,15 +176,6 @@ class InsertQuery(Query): self.objs = [] def insert_values(self, fields, objs, raw=False): - """ - Set up the insert query from the 'insert_values' dictionary. The - dictionary gives the model field names and their target values. - - If 'raw_values' is True, the values in the 'insert_values' dictionary - are inserted directly into the query, rather than passed as SQL - parameters. This provides a way to insert NULL and DEFAULT keywords - into the query, for example. - """ self.fields = fields self.objs = objs self.raw = raw @@ -197,8 +183,8 @@ class InsertQuery(Query): class AggregateQuery(Query): """ - An AggregateQuery takes another query as a parameter to the FROM - clause and only selects the elements in the provided list. + Take another query as a parameter to the FROM clause and only select the + elements in the provided list. """ compiler = 'SQLAggregateCompiler' |
