Skip to content
This repository has been archived by the owner on Feb 6, 2021. It is now read-only.

Commit

Permalink
Fixes #14
Browse files Browse the repository at this point in the history
- Thanks @sn0wmatt for reporting it in.
- Read the docs should build automatically
  • Loading branch information
devraj committed Sep 9, 2015
1 parent c7c1c3a commit a9ac24e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions source/data_adapters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Each ``DataAdapter`` provides two convenience methods:
bands = musicdb.models.Band().query()
self.response.http_status = prestans.rest.STATUS.OK
self.response.http_status = prestans.http.STATUS.OK
self.response.body = prestans.ext.data.adapters.ndb.adapt_persistent_collection(
collection=bands,
target_rest_instance=musicdb.rest.models.Band
Expand All @@ -160,7 +160,7 @@ If you are using ``AttributeFilters``, you should pass the filter along to the a
bands = musicdb.models.Band().query()
self.response.http_status = prestans.rest.STATUS.OK
self.response.http_status = prestans.http.STATUS.OK
self.response.body = prestans.ext.data.adapters.ndb.adapt_persistent_collection(
collection=bands,
target_rest_instance=musicdb.rest.models.Band,
Expand All @@ -174,7 +174,7 @@ If you are using ``AttributeFilters``, you should pass the filter along to the a
.. use the appropriate query to get the appropriate instance
self.response.http_status = prestans.rest.STATUS.OK
self.response.http_status = prestans.http.STATUS.OK
self.response.body = prestans.ext.data.adapters.ndb.adapt_persistent_instance(
collection=band,
target_rest_instance=musicdb.rest.models.Band,
Expand Down
2 changes: 1 addition & 1 deletion source/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Models are a great way of constructing sound responses. They are also serializab
... and so on until you copy all the values across
self.response.http_status = prestans.rest.STATUS.OK
self.response.http_status = prestans.http.STATUS.OK
self.response.body = album
From the above example it's clear that code to convert persistent objects into REST models becomes repetitive, and as a result error prone. Prestans provides ``DataAdapters``, that automate the conversion of persistent models to REST models. Read about it in the :doc:`data_adapters` chapter.
Expand Down

0 comments on commit a9ac24e

Please sign in to comment.