{"action":"created","comment":{"url":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/comments/200797003","pull_request_review_id":135187429,"id":200797003,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDc5NzAwMw==","diff_hunk":"@@ -858,6 +858,38 @@ def test_boolean_filters_on_boolean_field(self):\n \n                 )\n \n+    def test_sort_relation_field(self):\n+        url = '/users/?sort[]=location.name'\n+        with self.assertNumQueries(1):\n+            response = self.client.get(url)\n+        self.assertEquals(200, response.status_code)\n+        self.assertEquals(\n+            {\n+                'users': [\n+                    {'id': 1, 'location': 1, 'name': '0'},\n+                    {'id': 2, 'location': 1, 'name': '1'},\n+                    {'id': 3, 'location': 2, 'name': '2'},\n+                    {'id': 4, 'location': 3, 'name': '3'},\n+                ]\n+            },\n+            json.loads(response.content.decode('utf-8')))\n+\n+    def test_sort_relation_field_reverse(self):\n+        url = '/users/?sort[]=-location.name'\n+        with self.assertNumQueries(1):\n+            response = self.client.get(url)\n+        self.assertEquals(200, response.status_code)\n+        self.assertEquals(\n+            {\n+                'users': [\n+                    {'id': 4, 'location': 3, 'name': '3'},\n+                    {'id': 3, 'location': 2, 'name': '2'},\n+                    {'id': 1, 'location': 1, 'name': '0'},\n+                    {'id': 2, 'location': 1, 'name': '1'},","path":"tests/test_api.py","position":31,"original_position":31,"commit_id":"28cc43f0d78614f4c3bcc37bf4de8a945498abce","original_commit_id":"28cc43f0d78614f4c3bcc37bf4de8a945498abce","user":{"login":"ryochiji","id":172724,"node_id":"MDQ6VXNlcjE3MjcyNA==","avatar_url":"https://avatars0.githubusercontent.com/u/172724?v=4","gravatar_id":"","url":"https://api.github.com/users/ryochiji","html_url":"https://github.com/ryochiji","followers_url":"https://api.github.com/users/ryochiji/followers","following_url":"https://api.github.com/users/ryochiji/following{/other_user}","gists_url":"https://api.github.com/users/ryochiji/gists{/gist_id}","starred_url":"https://api.github.com/users/ryochiji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryochiji/subscriptions","organizations_url":"https://api.github.com/users/ryochiji/orgs","repos_url":"https://api.github.com/users/ryochiji/repos","events_url":"https://api.github.com/users/ryochiji/events{/privacy}","received_events_url":"https://api.github.com/users/ryochiji/received_events","type":"User","site_admin":false},"body":"Not sure how stable the last 2 items are and the potential for intermittent test failures. Maybe we can do something like:\r\n\r\n```python\r\nresponse = json.loads(response.content.decode('utf-8')))\r\nself.assertEquals(\r\n    [3, 2, 1, 1],\r\n    [row['location'] for row in response['users']]\r\n)\r\n```","created_at":"2018-07-07T00:41:20Z","updated_at":"2018-07-07T00:41:21Z","html_url":"https://github.com/AltSchool/dynamic-rest/pull/236#discussion_r200797003","pull_request_url":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/236","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/comments/200797003"},"html":{"href":"https://github.com/AltSchool/dynamic-rest/pull/236#discussion_r200797003"},"pull_request":{"href":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/236"}}},"pull_request":{"url":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/236","id":198108859,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4MTA4ODU5","html_url":"https://github.com/AltSchool/dynamic-rest/pull/236","diff_url":"https://github.com/AltSchool/dynamic-rest/pull/236.diff","patch_url":"https://github.com/AltSchool/dynamic-rest/pull/236.patch","issue_url":"https://api.github.com/repos/AltSchool/dynamic-rest/issues/236","number":236,"state":"open","locked":false,"title":"Add support for ordering by nested fields #171","user":{"login":"joshvillbrandt","id":3335568,"node_id":"MDQ6VXNlcjMzMzU1Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/3335568?v=4","gravatar_id":"","url":"https://api.github.com/users/joshvillbrandt","html_url":"https://github.com/joshvillbrandt","followers_url":"https://api.github.com/users/joshvillbrandt/followers","following_url":"https://api.github.com/users/joshvillbrandt/following{/other_user}","gists_url":"https://api.github.com/users/joshvillbrandt/gists{/gist_id}","starred_url":"https://api.github.com/users/joshvillbrandt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshvillbrandt/subscriptions","organizations_url":"https://api.github.com/users/joshvillbrandt/orgs","repos_url":"https://api.github.com/users/joshvillbrandt/repos","events_url":"https://api.github.com/users/joshvillbrandt/events{/privacy}","received_events_url":"https://api.github.com/users/joshvillbrandt/received_events","type":"User","site_admin":false},"body":"Rebasing @Incanus3's commit from #171.\r\n\r\nhttps://github.com/AltSchool/dynamic-rest/compare/master...Incanus3:feature/ordering-by-related-fields\r\n\r\nhttps://github.com/AltSchool/dynamic-rest/compare/d564cd10437cbd136db68a514481da29fd2a5ae7...master#diff-fbc210b7daea111dceb4ac7cec923baf","created_at":"2018-06-28T18:05:02Z","updated_at":"2018-07-07T00:41:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd13073bbf5cff6e4ee29bd0c99da9b9f1fb315c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/236/commits","review_comments_url":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/236/comments","review_comment_url":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AltSchool/dynamic-rest/issues/236/comments","statuses_url":"https://api.github.com/repos/AltSchool/dynamic-rest/statuses/28cc43f0d78614f4c3bcc37bf4de8a945498abce","head":{"label":"joshvillbrandt:nested_ordering","ref":"nested_ordering","sha":"28cc43f0d78614f4c3bcc37bf4de8a945498abce","user":{"login":"joshvillbrandt","id":3335568,"node_id":"MDQ6VXNlcjMzMzU1Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/3335568?v=4","gravatar_id":"","url":"https://api.github.com/users/joshvillbrandt","html_url":"https://github.com/joshvillbrandt","followers_url":"https://api.github.com/users/joshvillbrandt/followers","following_url":"https://api.github.com/users/joshvillbrandt/following{/other_user}","gists_url":"https://api.github.com/users/joshvillbrandt/gists{/gist_id}","starred_url":"https://api.github.com/users/joshvillbrandt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshvillbrandt/subscriptions","organizations_url":"https://api.github.com/users/joshvillbrandt/orgs","repos_url":"https://api.github.com/users/joshvillbrandt/repos","events_url":"https://api.github.com/users/joshvillbrandt/events{/privacy}","received_events_url":"https://api.github.com/users/joshvillbrandt/received_events","type":"User","site_admin":false},"repo":{"id":139048855,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwNDg4NTU=","name":"dynamic-rest","full_name":"joshvillbrandt/dynamic-rest","owner":{"login":"joshvillbrandt","id":3335568,"node_id":"MDQ6VXNlcjMzMzU1Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/3335568?v=4","gravatar_id":"","url":"https://api.github.com/users/joshvillbrandt","html_url":"https://github.com/joshvillbrandt","followers_url":"https://api.github.com/users/joshvillbrandt/followers","following_url":"https://api.github.com/users/joshvillbrandt/following{/other_user}","gists_url":"https://api.github.com/users/joshvillbrandt/gists{/gist_id}","starred_url":"https://api.github.com/users/joshvillbrandt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshvillbrandt/subscriptions","organizations_url":"https://api.github.com/users/joshvillbrandt/orgs","repos_url":"https://api.github.com/users/joshvillbrandt/repos","events_url":"https://api.github.com/users/joshvillbrandt/events{/privacy}","received_events_url":"https://api.github.com/users/joshvillbrandt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joshvillbrandt/dynamic-rest","description":"Dynamic extensions for Django REST Framework","fork":true,"url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest","forks_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/forks","keys_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/teams","hooks_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/hooks","issue_events_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/issues/events{/number}","events_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/events","assignees_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/assignees{/user}","branches_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/branches{/branch}","tags_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/tags","blobs_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/statuses/{sha}","languages_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/languages","stargazers_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/stargazers","contributors_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/contributors","subscribers_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/subscribers","subscription_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/subscription","commits_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/contents/{+path}","compare_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/merges","archive_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/downloads","issues_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/issues{/number}","pulls_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/pulls{/number}","milestones_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/milestones{/number}","notifications_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/labels{/name}","releases_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/releases{/id}","deployments_url":"https://api.github.com/repos/joshvillbrandt/dynamic-rest/deployments","created_at":"2018-06-28T17:25:23Z","updated_at":"2018-06-28T17:25:26Z","pushed_at":"2018-07-03T16:48:01Z","git_url":"git://github.com/joshvillbrandt/dynamic-rest.git","ssh_url":"git@github.com:joshvillbrandt/dynamic-rest.git","clone_url":"https://github.com/joshvillbrandt/dynamic-rest.git","svn_url":"https://github.com/joshvillbrandt/dynamic-rest","homepage":null,"size":2731,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AltSchool:master","ref":"master","sha":"dfe9fcaf52acdc8911737eec390bdb635912df2a","user":{"login":"AltSchool","id":4924852,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MjQ4NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/4924852?v=4","gravatar_id":"","url":"https://api.github.com/users/AltSchool","html_url":"https://github.com/AltSchool","followers_url":"https://api.github.com/users/AltSchool/followers","following_url":"https://api.github.com/users/AltSchool/following{/other_user}","gists_url":"https://api.github.com/users/AltSchool/gists{/gist_id}","starred_url":"https://api.github.com/users/AltSchool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltSchool/subscriptions","organizations_url":"https://api.github.com/users/AltSchool/orgs","repos_url":"https://api.github.com/users/AltSchool/repos","events_url":"https://api.github.com/users/AltSchool/events{/privacy}","received_events_url":"https://api.github.com/users/AltSchool/received_events","type":"Organization","site_admin":false},"repo":{"id":31736312,"node_id":"MDEwOlJlcG9zaXRvcnkzMTczNjMxMg==","name":"dynamic-rest","full_name":"AltSchool/dynamic-rest","owner":{"login":"AltSchool","id":4924852,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MjQ4NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/4924852?v=4","gravatar_id":"","url":"https://api.github.com/users/AltSchool","html_url":"https://github.com/AltSchool","followers_url":"https://api.github.com/users/AltSchool/followers","following_url":"https://api.github.com/users/AltSchool/following{/other_user}","gists_url":"https://api.github.com/users/AltSchool/gists{/gist_id}","starred_url":"https://api.github.com/users/AltSchool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltSchool/subscriptions","organizations_url":"https://api.github.com/users/AltSchool/orgs","repos_url":"https://api.github.com/users/AltSchool/repos","events_url":"https://api.github.com/users/AltSchool/events{/privacy}","received_events_url":"https://api.github.com/users/AltSchool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AltSchool/dynamic-rest","description":"Dynamic extensions for Django REST Framework","fork":false,"url":"https://api.github.com/repos/AltSchool/dynamic-rest","forks_url":"https://api.github.com/repos/AltSchool/dynamic-rest/forks","keys_url":"https://api.github.com/repos/AltSchool/dynamic-rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AltSchool/dynamic-rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AltSchool/dynamic-rest/teams","hooks_url":"https://api.github.com/repos/AltSchool/dynamic-rest/hooks","issue_events_url":"https://api.github.com/repos/AltSchool/dynamic-rest/issues/events{/number}","events_url":"https://api.github.com/repos/AltSchool/dynamic-rest/events","assignees_url":"https://api.github.com/repos/AltSchool/dynamic-rest/assignees{/user}","branches_url":"https://api.github.com/repos/AltSchool/dynamic-rest/branches{/branch}","tags_url":"https://api.github.com/repos/AltSchool/dynamic-rest/tags","blobs_url":"https://api.github.com/repos/AltSchool/dynamic-rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AltSchool/dynamic-rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AltSchool/dynamic-rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/AltSchool/dynamic-rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AltSchool/dynamic-rest/statuses/{sha}","languages_url":"https://api.github.com/repos/AltSchool/dynamic-rest/languages","stargazers_url":"https://api.github.com/repos/AltSchool/dynamic-rest/stargazers","contributors_url":"https://api.github.com/repos/AltSchool/dynamic-rest/contributors","subscribers_url":"https://api.github.com/repos/AltSchool/dynamic-rest/subscribers","subscription_url":"https://api.github.com/repos/AltSchool/dynamic-rest/subscription","commits_url":"https://api.github.com/repos/AltSchool/dynamic-rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/AltSchool/dynamic-rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/AltSchool/dynamic-rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/AltSchool/dynamic-rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/AltSchool/dynamic-rest/contents/{+path}","compare_url":"https://api.github.com/repos/AltSchool/dynamic-rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AltSchool/dynamic-rest/merges","archive_url":"https://api.github.com/repos/AltSchool/dynamic-rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AltSchool/dynamic-rest/downloads","issues_url":"https://api.github.com/repos/AltSchool/dynamic-rest/issues{/number}","pulls_url":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls{/number}","milestones_url":"https://api.github.com/repos/AltSchool/dynamic-rest/milestones{/number}","notifications_url":"https://api.github.com/repos/AltSchool/dynamic-rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AltSchool/dynamic-rest/labels{/name}","releases_url":"https://api.github.com/repos/AltSchool/dynamic-rest/releases{/id}","deployments_url":"https://api.github.com/repos/AltSchool/dynamic-rest/deployments","created_at":"2015-03-05T21:05:17Z","updated_at":"2018-06-21T11:33:35Z","pushed_at":"2018-07-03T16:48:03Z","git_url":"git://github.com/AltSchool/dynamic-rest.git","ssh_url":"git@github.com:AltSchool/dynamic-rest.git","clone_url":"https://github.com/AltSchool/dynamic-rest.git","svn_url":"https://github.com/AltSchool/dynamic-rest","homepage":null,"size":2730,"stargazers_count":246,"watchers_count":246,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":27,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":33,"open_issues":27,"watchers":246,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/236"},"html":{"href":"https://github.com/AltSchool/dynamic-rest/pull/236"},"issue":{"href":"https://api.github.com/repos/AltSchool/dynamic-rest/issues/236"},"comments":{"href":"https://api.github.com/repos/AltSchool/dynamic-rest/issues/236/comments"},"review_comments":{"href":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/236/comments"},"review_comment":{"href":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AltSchool/dynamic-rest/pulls/236/commits"},"statuses":{"href":"https://api.github.com/repos/AltSchool/dynamic-rest/statuses/28cc43f0d78614f4c3bcc37bf4de8a945498abce"}},"author_association":"NONE"}}
{"actor":{"display_login":"ryochiji"}}