Skip to content

Commit

Permalink
docs: use Thread model in batch sample code (#605)
Browse files Browse the repository at this point in the history
The batch operations docs were using the TestModel class which is not explained in this section of the docs. The example code was supposed to use the Thread class.
  • Loading branch information
Matthew Egan authored and ikonst committed Apr 1, 2019
1 parent 79fd479 commit 356eddd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/batch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Here is an example using a context manager for a bulk write operation:
.. code-block:: python
with Thread.batch_write() as batch:
items = [TestModel('forum-{0}'.format(x), 'thread-{0}'.format(x)) for x in range(1000)]
items = [Thread('forum-{0}'.format(x), 'subject-{0}'.format(x)) for x in range(1000)]
for item in items:
batch.save(item)
Expand All @@ -49,7 +49,7 @@ Here is an example using an iterator for retrieving items in bulk:

.. code-block:: python
item_keys = [('forum-{0}'.format(x), 'thread-{0}'.format(x)) for x in range(1000)]
item_keys = [('forum-{0}'.format(x), 'subject-{0}'.format(x)) for x in range(1000)]
for item in Thread.batch_get(item_keys):
print(item)
Expand Down

0 comments on commit 356eddd

Please sign in to comment.