Skip to content

Commit

Permalink
updating docs to reflect new way to access 'data' exector attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
filipeximenes committed Nov 9, 2015
1 parent 2782513 commit 991e077
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/source/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can also access a tapioca client that contains response data from the except
try:
cli.fetch_something().get()
except TapiocaException, e:
print(e.client.error_message().data())
print(e.client.error_message().data)
.. class:: ClientError

Expand Down
13 changes: 7 additions & 6 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ To print the returned data do:

.. code-block:: python
In [9]: likes().data()
In [9]: likes().data
OUT [9]: {
'data': [...],
'paging': {...}
Expand Down Expand Up @@ -126,7 +126,7 @@ You can iterate over returned data:
likes = api.user_likes(id='me').get()
for like in likes.data:
print(like.id().data())
print(like.id().data)
Items passed to the ``for`` loop will be wrapped in tapioca so you still have access to all features.

Expand Down Expand Up @@ -175,18 +175,19 @@ Please read `requests <http://docs.python-requests.org/en/latest/>`_ for more de
Accessing raw data
------------------

Use data to return data contained in the Tapioca object
Use ``data`` to return data contained in the Tapioca object.

.. code-block:: python
>>> likes = api.user_likes(id='me').get()
>>> likes().data()
>>> likes().data
{
'data': [...],
'paging': {...}
}
>>> this will print only the array contained
>>> # in the 'data' field of the response
>>> likes.data().data()
>>> likes.data().data
>>> [...]
Dynamically fetching pages
Expand All @@ -200,7 +201,7 @@ Tapioca is built to provide an easy way to access paged data using ``pages()`` m
likes = api.user_likes(id='me').get()
for like in likes().pages():
print(like.name().data())
print(like.name().data
This will keep fetching user likes until there are none left. Items passed to the ``for`` loop will be wrapped in tapioca so you still have access to all features.
Expand Down

0 comments on commit 991e077

Please sign in to comment.