This repository has been archived by the owner on Sep 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revised documentation in preparation of 0.2.2
- Loading branch information
Showing
6 changed files
with
57 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Example Project | ||
=============== | ||
|
||
For an example of how to use Nefertari see the `Example Project <https://github.com/brandicted/nefertari-example>`_. | ||
For a more complete example of a Pyramid project using Nefertari, you can take a look at the `Example Project <https://github.com/brandicted/nefertari-example>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Configuring views | ||
================= | ||
|
||
Introduction | ||
------------ | ||
|
||
It is recommended that your views reside in a package. In this case, each module of that package would contain all views of any given root-level route. Alternatively, ou can explicitly provide a view name, or a view class as ``view`` keyword argument to ``resource.add()`` in your project's ``main`` function. In the case of a singular resource, there is no need to define ``index`` and ``show`` returns only one item. | ||
|
||
* *index*: called upon ``GET`` request to a collection, e.g. ``/collection`` | ||
* *show*: called upon ``GET`` request to a collection-item, e.g. ``/collection/<id>`` | ||
* *create*: called upon ``POST`` request to a collection | ||
* *update*: called upon ``PATCH`` request to a collection-item | ||
* *delete*: called upon ``DELETE`` request to a collection-item | ||
* *update_many*: called upon ``PATCH`` request to a collection or filtered collection, e.g. ``/collection?_exists_=<field>`` | ||
* *delete_many*: called upon ``DELETE`` request to a collection or filtered collection | ||
|
||
Notes | ||
----- | ||
|
||
When using SQLA, each view must define the following properties: | ||
* *_model_class*: class of the model that is being served by this view. | ||
|
||
Optional properties: | ||
* *_json_encoder*: encoder to encode objects to JSON. Database-specific encoders are available at ``nefertari.engine.JSONEncoder``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters