{"action":"created","comment":{"url":"https://api.github.com/repos/ShipChain/transmission/pulls/comments/233190537","pull_request_review_id":174546422,"id":233190537,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzE5MDUzNw==","diff_hunk":"@@ -22,12 +23,26 @@ class ShipmentViewSet(viewsets.ModelViewSet):\n     serializer_class = ShipmentSerializer\n     permission_classes = ((permissions.IsAuthenticated, IsOwner) if settings.PROFILES_ENABLED\n                           else (permissions.AllowAny,))\n+    filter_backends = (filters.SearchFilter, filters.OrderingFilter, DjangoFilterBackend,)\n+    searchable_fields = ['mode', 'pickup_estimated', 'delivery_estimated']\n+    for location_field in ['ship_from_location', 'ship_to_location', 'final_destination_location']:\n+        for field in ['name', 'address_1', 'city', 'state', 'postal_code', 'country']:\n+            searchable_fields.append(f'{location_field}__{field}')\n+\n+    search_fields = tuple(searchable_fields)\n+    ordering_fields = ('modified_at', 'created_at', 'pickup_estimated', 'delivery_estimated')\n     http_method_names = ['get', 'post', 'delete', 'patch']\n \n     def get_queryset(self):\n         queryset = self.queryset\n         if settings.PROFILES_ENABLED:\n             queryset = queryset.filter(owner_id=self.request.user.id)\n+        if 'ship_from_location_not_null' in self.request.query_params:","path":"apps/shipments/views.py","position":28,"original_position":28,"commit_id":"c9d3a2f36ce52b406d181b29a6c374d153e6f8ff","original_commit_id":"c9d3a2f36ce52b406d181b29a6c374d153e6f8ff","user":{"login":"ajhodges","id":856738,"node_id":"MDQ6VXNlcjg1NjczOA==","avatar_url":"https://avatars2.githubusercontent.com/u/856738?v=4","gravatar_id":"","url":"https://api.github.com/users/ajhodges","html_url":"https://github.com/ajhodges","followers_url":"https://api.github.com/users/ajhodges/followers","following_url":"https://api.github.com/users/ajhodges/following{/other_user}","gists_url":"https://api.github.com/users/ajhodges/gists{/gist_id}","starred_url":"https://api.github.com/users/ajhodges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajhodges/subscriptions","organizations_url":"https://api.github.com/users/ajhodges/orgs","repos_url":"https://api.github.com/users/ajhodges/repos","events_url":"https://api.github.com/users/ajhodges/events{/privacy}","received_events_url":"https://api.github.com/users/ajhodges/received_events","type":"User","site_admin":false},"body":"I believe if you use a FilterSet as described above, you can take out all this not_null stuff, because it should be provided by the FilterSet.","created_at":"2018-11-13T19:29:45Z","updated_at":"2018-11-13T19:33:22Z","html_url":"https://github.com/ShipChain/transmission/pull/27#discussion_r233190537","pull_request_url":"https://api.github.com/repos/ShipChain/transmission/pulls/27","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ShipChain/transmission/pulls/comments/233190537"},"html":{"href":"https://github.com/ShipChain/transmission/pull/27#discussion_r233190537"},"pull_request":{"href":"https://api.github.com/repos/ShipChain/transmission/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/ShipChain/transmission/pulls/27","id":229712344,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NzEyMzQ0","html_url":"https://github.com/ShipChain/transmission/pull/27","diff_url":"https://github.com/ShipChain/transmission/pull/27.diff","patch_url":"https://github.com/ShipChain/transmission/pull/27.patch","issue_url":"https://api.github.com/repos/ShipChain/transmission/issues/27","number":27,"state":"open","locked":false,"title":"Add filtering and ordering options for shipments","user":{"login":"jamesfneyer","id":26972385,"node_id":"MDQ6VXNlcjI2OTcyMzg1","avatar_url":"https://avatars2.githubusercontent.com/u/26972385?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesfneyer","html_url":"https://github.com/jamesfneyer","followers_url":"https://api.github.com/users/jamesfneyer/followers","following_url":"https://api.github.com/users/jamesfneyer/following{/other_user}","gists_url":"https://api.github.com/users/jamesfneyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesfneyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesfneyer/subscriptions","organizations_url":"https://api.github.com/users/jamesfneyer/orgs","repos_url":"https://api.github.com/users/jamesfneyer/repos","events_url":"https://api.github.com/users/jamesfneyer/events{/privacy}","received_events_url":"https://api.github.com/users/jamesfneyer/received_events","type":"User","site_admin":false},"body":"It is important to grab only the information necessary when making calls to the backend. Adding filters allows users to search for specific shipment information, and ordering allows them to retrieve them in the desired way.","created_at":"2018-11-09T14:35:12Z","updated_at":"2018-11-13T19:33:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"851403afb86b48d2a9d9da24d299be44e1ac88bd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ShipChain/transmission/pulls/27/commits","review_comments_url":"https://api.github.com/repos/ShipChain/transmission/pulls/27/comments","review_comment_url":"https://api.github.com/repos/ShipChain/transmission/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ShipChain/transmission/issues/27/comments","statuses_url":"https://api.github.com/repos/ShipChain/transmission/statuses/c9d3a2f36ce52b406d181b29a6c374d153e6f8ff","head":{"label":"ShipChain:feature/ordering-and-search-for-shipments","ref":"feature/ordering-and-search-for-shipments","sha":"c9d3a2f36ce52b406d181b29a6c374d153e6f8ff","user":{"login":"ShipChain","id":33128412,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMTI4NDEy","avatar_url":"https://avatars2.githubusercontent.com/u/33128412?v=4","gravatar_id":"","url":"https://api.github.com/users/ShipChain","html_url":"https://github.com/ShipChain","followers_url":"https://api.github.com/users/ShipChain/followers","following_url":"https://api.github.com/users/ShipChain/following{/other_user}","gists_url":"https://api.github.com/users/ShipChain/gists{/gist_id}","starred_url":"https://api.github.com/users/ShipChain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShipChain/subscriptions","organizations_url":"https://api.github.com/users/ShipChain/orgs","repos_url":"https://api.github.com/users/ShipChain/repos","events_url":"https://api.github.com/users/ShipChain/events{/privacy}","received_events_url":"https://api.github.com/users/ShipChain/received_events","type":"Organization","site_admin":false},"repo":{"id":147361455,"node_id":"MDEwOlJlcG9zaXRvcnkxNDczNjE0NTU=","name":"transmission","full_name":"ShipChain/transmission","private":false,"owner":{"login":"ShipChain","id":33128412,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMTI4NDEy","avatar_url":"https://avatars2.githubusercontent.com/u/33128412?v=4","gravatar_id":"","url":"https://api.github.com/users/ShipChain","html_url":"https://github.com/ShipChain","followers_url":"https://api.github.com/users/ShipChain/followers","following_url":"https://api.github.com/users/ShipChain/following{/other_user}","gists_url":"https://api.github.com/users/ShipChain/gists{/gist_id}","starred_url":"https://api.github.com/users/ShipChain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShipChain/subscriptions","organizations_url":"https://api.github.com/users/ShipChain/orgs","repos_url":"https://api.github.com/users/ShipChain/repos","events_url":"https://api.github.com/users/ShipChain/events{/privacy}","received_events_url":"https://api.github.com/users/ShipChain/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ShipChain/transmission","description":"A Django REST API built to proxy Ethereum requests via ShipChain Engine.","fork":false,"url":"https://api.github.com/repos/ShipChain/transmission","forks_url":"https://api.github.com/repos/ShipChain/transmission/forks","keys_url":"https://api.github.com/repos/ShipChain/transmission/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShipChain/transmission/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShipChain/transmission/teams","hooks_url":"https://api.github.com/repos/ShipChain/transmission/hooks","issue_events_url":"https://api.github.com/repos/ShipChain/transmission/issues/events{/number}","events_url":"https://api.github.com/repos/ShipChain/transmission/events","assignees_url":"https://api.github.com/repos/ShipChain/transmission/assignees{/user}","branches_url":"https://api.github.com/repos/ShipChain/transmission/branches{/branch}","tags_url":"https://api.github.com/repos/ShipChain/transmission/tags","blobs_url":"https://api.github.com/repos/ShipChain/transmission/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShipChain/transmission/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShipChain/transmission/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShipChain/transmission/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShipChain/transmission/statuses/{sha}","languages_url":"https://api.github.com/repos/ShipChain/transmission/languages","stargazers_url":"https://api.github.com/repos/ShipChain/transmission/stargazers","contributors_url":"https://api.github.com/repos/ShipChain/transmission/contributors","subscribers_url":"https://api.github.com/repos/ShipChain/transmission/subscribers","subscription_url":"https://api.github.com/repos/ShipChain/transmission/subscription","commits_url":"https://api.github.com/repos/ShipChain/transmission/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShipChain/transmission/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShipChain/transmission/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShipChain/transmission/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShipChain/transmission/contents/{+path}","compare_url":"https://api.github.com/repos/ShipChain/transmission/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShipChain/transmission/merges","archive_url":"https://api.github.com/repos/ShipChain/transmission/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShipChain/transmission/downloads","issues_url":"https://api.github.com/repos/ShipChain/transmission/issues{/number}","pulls_url":"https://api.github.com/repos/ShipChain/transmission/pulls{/number}","milestones_url":"https://api.github.com/repos/ShipChain/transmission/milestones{/number}","notifications_url":"https://api.github.com/repos/ShipChain/transmission/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShipChain/transmission/labels{/name}","releases_url":"https://api.github.com/repos/ShipChain/transmission/releases{/id}","deployments_url":"https://api.github.com/repos/ShipChain/transmission/deployments","created_at":"2018-09-04T14:43:38Z","updated_at":"2018-11-08T15:13:59Z","pushed_at":"2018-11-13T17:57:49Z","git_url":"git://github.com/ShipChain/transmission.git","ssh_url":"git@github.com:ShipChain/transmission.git","clone_url":"https://github.com/ShipChain/transmission.git","svn_url":"https://github.com/ShipChain/transmission","homepage":null,"size":328,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":4,"watchers":14,"default_branch":"master"}},"base":{"label":"ShipChain:master","ref":"master","sha":"bdded12feefad047f684c976936d93f52ae81ecf","user":{"login":"ShipChain","id":33128412,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMTI4NDEy","avatar_url":"https://avatars2.githubusercontent.com/u/33128412?v=4","gravatar_id":"","url":"https://api.github.com/users/ShipChain","html_url":"https://github.com/ShipChain","followers_url":"https://api.github.com/users/ShipChain/followers","following_url":"https://api.github.com/users/ShipChain/following{/other_user}","gists_url":"https://api.github.com/users/ShipChain/gists{/gist_id}","starred_url":"https://api.github.com/users/ShipChain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShipChain/subscriptions","organizations_url":"https://api.github.com/users/ShipChain/orgs","repos_url":"https://api.github.com/users/ShipChain/repos","events_url":"https://api.github.com/users/ShipChain/events{/privacy}","received_events_url":"https://api.github.com/users/ShipChain/received_events","type":"Organization","site_admin":false},"repo":{"id":147361455,"node_id":"MDEwOlJlcG9zaXRvcnkxNDczNjE0NTU=","name":"transmission","full_name":"ShipChain/transmission","private":false,"owner":{"login":"ShipChain","id":33128412,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMTI4NDEy","avatar_url":"https://avatars2.githubusercontent.com/u/33128412?v=4","gravatar_id":"","url":"https://api.github.com/users/ShipChain","html_url":"https://github.com/ShipChain","followers_url":"https://api.github.com/users/ShipChain/followers","following_url":"https://api.github.com/users/ShipChain/following{/other_user}","gists_url":"https://api.github.com/users/ShipChain/gists{/gist_id}","starred_url":"https://api.github.com/users/ShipChain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShipChain/subscriptions","organizations_url":"https://api.github.com/users/ShipChain/orgs","repos_url":"https://api.github.com/users/ShipChain/repos","events_url":"https://api.github.com/users/ShipChain/events{/privacy}","received_events_url":"https://api.github.com/users/ShipChain/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ShipChain/transmission","description":"A Django REST API built to proxy Ethereum requests via ShipChain Engine.","fork":false,"url":"https://api.github.com/repos/ShipChain/transmission","forks_url":"https://api.github.com/repos/ShipChain/transmission/forks","keys_url":"https://api.github.com/repos/ShipChain/transmission/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShipChain/transmission/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShipChain/transmission/teams","hooks_url":"https://api.github.com/repos/ShipChain/transmission/hooks","issue_events_url":"https://api.github.com/repos/ShipChain/transmission/issues/events{/number}","events_url":"https://api.github.com/repos/ShipChain/transmission/events","assignees_url":"https://api.github.com/repos/ShipChain/transmission/assignees{/user}","branches_url":"https://api.github.com/repos/ShipChain/transmission/branches{/branch}","tags_url":"https://api.github.com/repos/ShipChain/transmission/tags","blobs_url":"https://api.github.com/repos/ShipChain/transmission/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShipChain/transmission/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShipChain/transmission/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShipChain/transmission/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShipChain/transmission/statuses/{sha}","languages_url":"https://api.github.com/repos/ShipChain/transmission/languages","stargazers_url":"https://api.github.com/repos/ShipChain/transmission/stargazers","contributors_url":"https://api.github.com/repos/ShipChain/transmission/contributors","subscribers_url":"https://api.github.com/repos/ShipChain/transmission/subscribers","subscription_url":"https://api.github.com/repos/ShipChain/transmission/subscription","commits_url":"https://api.github.com/repos/ShipChain/transmission/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShipChain/transmission/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShipChain/transmission/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShipChain/transmission/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShipChain/transmission/contents/{+path}","compare_url":"https://api.github.com/repos/ShipChain/transmission/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShipChain/transmission/merges","archive_url":"https://api.github.com/repos/ShipChain/transmission/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShipChain/transmission/downloads","issues_url":"https://api.github.com/repos/ShipChain/transmission/issues{/number}","pulls_url":"https://api.github.com/repos/ShipChain/transmission/pulls{/number}","milestones_url":"https://api.github.com/repos/ShipChain/transmission/milestones{/number}","notifications_url":"https://api.github.com/repos/ShipChain/transmission/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShipChain/transmission/labels{/name}","releases_url":"https://api.github.com/repos/ShipChain/transmission/releases{/id}","deployments_url":"https://api.github.com/repos/ShipChain/transmission/deployments","created_at":"2018-09-04T14:43:38Z","updated_at":"2018-11-08T15:13:59Z","pushed_at":"2018-11-13T17:57:49Z","git_url":"git://github.com/ShipChain/transmission.git","ssh_url":"git@github.com:ShipChain/transmission.git","clone_url":"https://github.com/ShipChain/transmission.git","svn_url":"https://github.com/ShipChain/transmission","homepage":null,"size":328,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":4,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ShipChain/transmission/pulls/27"},"html":{"href":"https://github.com/ShipChain/transmission/pull/27"},"issue":{"href":"https://api.github.com/repos/ShipChain/transmission/issues/27"},"comments":{"href":"https://api.github.com/repos/ShipChain/transmission/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/ShipChain/transmission/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/ShipChain/transmission/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ShipChain/transmission/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/ShipChain/transmission/statuses/c9d3a2f36ce52b406d181b29a6c374d153e6f8ff"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ajhodges"}}