Skip to content

Commit 7907d96

Browse files
committed
some docs changes
1 parent 80ff3b7 commit 7907d96

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

cassandra/cqlengine/query.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,6 @@ def __init__(self, batch_type=None, timestamp=None, consistency=None, execute_on
175175
self._context_entered = False
176176

177177
def add_query(self, query):
178-
"""
179-
Adds a query to the batch.
180-
181-
:param query: The query
182-
"""
183178
if not isinstance(query, BaseCQLStatement):
184179
raise CQLEngineException('only BaseCQLStatements can be added to a batch query')
185180
self.queries.append(query)
@@ -209,9 +204,6 @@ def add_callback(self, fn, *args, **kwargs):
209204
self._callbacks.append((fn, args, kwargs))
210205

211206
def execute(self):
212-
"""
213-
Executes the batch.
214-
"""
215207
if self._executed and self.warn_multiple_exec:
216208
msg = "Batch executed multiple times."
217209
if self._context_entered:
@@ -271,7 +263,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
271263

272264
class ContextQuery(object):
273265
"""
274-
A Context manager to allow a Model to switch context easily. Presently, the context only
266+
A Context manager to allow a Model to switch context easily. Presently, the context only
275267
specifies a keyspace for model IO.
276268
277269
For example:
@@ -289,7 +281,7 @@ class ContextQuery(object):
289281

290282
def __init__(self, model, keyspace=None):
291283
"""
292-
:param model: A model
284+
:param model: A model. This should be a class type, not an instance.
293285
:param keyspace: (optional) A keyspace name
294286
"""
295287
from cassandra.cqlengine import models

docs/api/cassandra/cqlengine/query.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ The methods here are used to filter, order, and constrain results.
5757
.. autoclass:: BatchQuery
5858
:members:
5959

60+
.. automethod:: add_query
61+
.. automethod:: execute
62+
6063
.. autoclass:: ContextQuery
6164

6265
.. autoclass:: DoesNotExist

0 commit comments

Comments
 (0)