Skip to content

Commit

Permalink
use records JSON format by default
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Apr 10, 2015
1 parent 88941ad commit 5faa4ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rest_pandas/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class PandasJSONRenderer(PandasBaseRenderer):

def get_pandas_kwargs(self, data):
return {
'orient': 'index',
'orient': 'records',
'date_format': 'iso',
}

Expand Down
4 changes: 2 additions & 2 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def test_view_json(self):
response = self.client.get("/timeseries.json")
self.assertEqual(response.accepted_media_type, "application/json")
data = json.loads(response.content.decode('utf-8'))
self.assertEqual(len(data.keys()), 5)
self.assertEqual(data["1"]["value"], 0.5)
self.assertEqual(len(data), 5)
self.assertEqual(data[0]["value"], 0.5)

def test_viewset(self):
response = self.client.get("/router/timeseries/.csv")
Expand Down

0 comments on commit 5faa4ec

Please sign in to comment.