Skip to content

Commit

Permalink
Brief summary of common gapipy fields
Browse files Browse the repository at this point in the history
  • Loading branch information
annakovale committed Oct 11, 2016
1 parent 3a69683 commit 63998c8
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,49 @@ tests can successfully hit the API::

$ export GAPI_APPLICATION_KEY=MY_SECRET_KEY; nosetests

Fields
------

* ``_model_fields`` represent dictionary fields like so:

Note: ``_model_fields = [('address', Address)]`` and ``Address`` subclasses ``BaseModel``

.. code-block:: python
"address": {
"street": "19 Charlotte St",
"city": "Toronto",
"state": {
"id": "CA-ON",
"href": "https://rest.gadventures.com/states/CA-ON",
"name": "Ontario"
},
"country": {
"id": "CA",
"href": "https://rest.gadventures.com/countries/CA",
"name": "Canada"
},
"postal_zip": "M5V 2H5"
}
* ``_model_collection_fields`` represent a list of dictionary fields like so:

Note: ``_model_collection_fields = [('emails', AgencyEmail),]`` and ``Address`` subclasses ``BaseModel``

.. code-block:: python
"emails": [
{
"type": "ALLOCATIONS_RELEASE",
"address": "g@gadventures.com"
},
{
"type": "ALLOCATIONS_RELEASE",
"address": "g2@gadventures.com"
}
]
* ``_resource_fields`` refer to another ``Resource``

Thanks for helping!

0 comments on commit 63998c8

Please sign in to comment.