Skip to content

Commit 799a760

Browse files
committed
Started updating documentation
1 parent bf432d6 commit 799a760

File tree

1 file changed

+36
-48
lines changed

1 file changed

+36
-48
lines changed

README.rst

Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,44 @@
11
====================================
2-
Ember Data and Django Rest Framework
2+
JSON API and Django Rest Framework
33
====================================
44

5-
.. image:: https://travis-ci.org/django-json-api/rest_framework_ember.svg?branch=master
6-
:target: https://travis-ci.org/django-json-api/rest_framework_ember
7-
8-
The default Ember Data REST Adapter conventions differ from the default
9-
Django Rest Framework JSON request and response format. Instead of adding
10-
a Django specific adapter to Ember Data we use this adapter in Django to
11-
output and accept JSON in the format the Ember Data REST Adapter expects.
5+
.. image:: https://travis-ci.org/django-json-api/rest_framework_json_api.svg?branch=develop
6+
:target: https://travis-ci.org/django-json-api/rest_framework_json_api
127

138
By default, Django REST Framework will produce a response like::
149

1510
{
1611
"count": 20,
17-
"next": "http://example.com/api/1.0/identities/?page=2",
18-
"previous": null,
19-
"results": [
20-
{
21-
"id": 1,
22-
"username": "john",
23-
"full_name": "John Coltrane"
24-
},
25-
{
26-
...
27-
}
28-
]
12+
"next": "http://example.com/api/1.0/identities/?page=3",
13+
"previous": "http://example.com/api/1.0/identities/?page=1",
14+
"results": [{
15+
"id": 3,
16+
"username": "john",
17+
"full_name": "John Coltrane"
18+
}]
2919
}
3020

3121

32-
However, for an ``identity`` model in EmberJS, the Ember Data REST Adapter
33-
expects a response to look like the following::
22+
However, for an ``identity`` model in JSON API format the response should look
23+
like the following::
3424

3525
{
36-
"identity": [
37-
{
38-
"id": 1,
26+
"links": {
27+
"prev": "http://example.com/api/1.0/identities",
28+
"self": "http://example.com/api/1.0/identities?page=2",
29+
"next": "http://example.com/api/1.0/identities?page=3",
30+
},
31+
"data": [{
32+
"type": "identities",
33+
"id": 3,
34+
"attributes": {
3935
"username": "john",
4036
"full_name": "John Coltrane"
4137
},
42-
{
43-
...
44-
}
45-
],
46-
"meta": {
47-
"count": 20,
48-
"next": 2,
49-
"next_link": "http://example.com/api/1.0/identities/?page=2",
50-
"page": 1,
51-
"previous": null,
52-
"previous_link": null
53-
}
38+
"meta": {
39+
"count": 20,
40+
},
41+
}],
5442
}
5543

5644

@@ -70,16 +58,16 @@ From PyPI
7058

7159
::
7260

73-
pip install rest_framework_ember
61+
pip install rest_framework_json_api
7462

7563

7664
From Source
7765
^^^^^^^^^^^
7866

7967
::
8068

81-
$ git clone https://github.com/ngenworks/rest_framework_ember.git
82-
$ cd rest_framework_ember && pip install -e .
69+
$ git clone https://github.com/django-json-api/rest_framework_json_api.git
70+
$ cd rest_framework_json_api && pip install -e .
8371

8472

8573
Running Tests
@@ -95,15 +83,15 @@ Usage
9583
-----
9684

9785

98-
``rest_framework_ember`` assumes you are using class-based views in Django
86+
``rest_framework_json_api`` assumes you are using class-based views in Django
9987
Rest Framework.
10088

10189

10290
Settings
10391
^^^^^^^^
10492

105-
One can either add ``rest_framework_ember.parsers.JSONParser`` and
106-
``rest_framework_ember.renderers.JSONRenderer`` to each ``ViewSet`` class, or
93+
One can either add ``rest_framework_json_api.parsers.JSONParser`` and
94+
``rest_framework_json_api.renderers.JSONRenderer`` to each ``ViewSet`` class, or
10795
override ``settings.REST_FRAMEWORK``::
10896

10997

@@ -113,17 +101,17 @@ override ``settings.REST_FRAMEWORK``::
113101
'MAX_PAGINATE_BY': 100,
114102
# DRF v3.1+
115103
'DEFAULT_PAGINATION_CLASS':
116-
'rest_framework_ember.pagination.PageNumberPagination',
104+
'rest_framework_json_api.pagination.PageNumberPagination',
117105
# older than DRF v3.1
118106
'DEFAULT_PAGINATION_SERIALIZER_CLASS':
119-
'rest_framework_ember.pagination.PaginationSerializer',
107+
'rest_framework_json_api.pagination.PaginationSerializer',
120108
'DEFAULT_PARSER_CLASSES': (
121-
'rest_framework_ember.parsers.JSONParser',
109+
'rest_framework_json_api.parsers.JSONParser',
122110
'rest_framework.parsers.FormParser',
123111
'rest_framework.parsers.MultiPartParser'
124112
),
125113
'DEFAULT_RENDERER_CLASSES': (
126-
'rest_framework_ember.renderers.JSONRenderer',
114+
'rest_framework_json_api.renderers.JSONRenderer',
127115
'rest_framework.renderers.BrowsableAPIRenderer',
128116
),
129117
}
@@ -311,7 +299,7 @@ Mixins
311299
The following mixin classes are available to use with Rest Framework
312300
resources.
313301

314-
rest_framework_ember.mixins.MultipleIDMixin
302+
rest_framework_json_api.mixins.MultipleIDMixin
315303
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
316304

317305
Overrides ``get_queryset`` to filter by ``ids[]`` in URL query params.

0 commit comments

Comments
 (0)