A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/wq/django-rest-pandas/commit/5faa4ec4d32466dac89ef117392faa87428a801f below:

use records JSON format by default · wq/django-rest-pandas@5faa4ec · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+3

-3

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+3

-3

lines changed Original file line number Diff line number Diff line change

@@ -98,7 +98,7 @@ class PandasJSONRenderer(PandasBaseRenderer):

98 98 99 99

def get_pandas_kwargs(self, data):

100 100

return {

101 -

'orient': 'index',

101 +

'orient': 'records',

102 102

'date_format': 'iso',

103 103

}

104 104 Original file line number Diff line number Diff line change

@@ -26,8 +26,8 @@ def test_view_json(self):

26 26

response = self.client.get("/timeseries.json")

27 27

self.assertEqual(response.accepted_media_type, "application/json")

28 28

data = json.loads(response.content.decode('utf-8'))

29 -

self.assertEqual(len(data.keys()), 5)

30 -

self.assertEqual(data["1"]["value"], 0.5)

29 +

self.assertEqual(len(data), 5)

30 +

self.assertEqual(data[0]["value"], 0.5)

31 31 32 32

def test_viewset(self):

33 33

response = self.client.get("/router/timeseries/.csv")

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4