{"action":"created","comment":{"url":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/comments/64759679","id":64759679,"diff_hunk":"@@ -69,31 +73,91 @@ def get_object(self, queryset=None):\n         return o\n \n \n-class ExportsListView(LoginRequiredMixin, FrontendAccessRequiredMixin, ListView):\n+class ExportsListMixin:\n+    @property\n+    def excerpt_ids(self):\n+        if not hasattr(self, '_excerpt_ids'):\n+            self._excerpt_ids = list(\n+                OrderedSet(\n+                    self.get_user_exports()\n+                    .values_list('extraction_order__excerpt', flat=True)\n+                )\n+            )\n+        return self._excerpt_ids\n+\n+    @property\n+    def status_choices(self):\n+        allowed_choices = [\n+            statuses.FINISHED,\n+            statuses.FAILED,\n+        ]\n+        return [choice for choice in Export.STATUS_CHOICES if choice[0] in allowed_choices]\n+\n+    def get_user_exports(self):\n+        return self._filter_exports(\n+            Export.objects.filter(extraction_order__orderer=self.request.user)\n+        ).order_by('-updated', '-finished')\n+\n+    def _filter_exports(self, query):\n+        allowed_status_filters = [\n+            status[0] for status in self.status_choices\n+        ]\n+        status_filter = self.request.GET.get('status', None)\n+        if status_filter and status_filter in allowed_status_filters:","path":"osmaxx/excerptexport/views.py","position":59,"original_position":59,"commit_id":"9159ba5a17ff62ffb404ec775c6661d7ca87b186","original_commit_id":"9159ba5a17ff62ffb404ec775c6661d7ca87b186","user":{"login":"das-g","id":97746,"avatar_url":"https://avatars.githubusercontent.com/u/97746?v=3","gravatar_id":"","url":"https://api.github.com/users/das-g","html_url":"https://github.com/das-g","followers_url":"https://api.github.com/users/das-g/followers","following_url":"https://api.github.com/users/das-g/following{/other_user}","gists_url":"https://api.github.com/users/das-g/gists{/gist_id}","starred_url":"https://api.github.com/users/das-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/das-g/subscriptions","organizations_url":"https://api.github.com/users/das-g/orgs","repos_url":"https://api.github.com/users/das-g/repos","events_url":"https://api.github.com/users/das-g/events{/privacy}","received_events_url":"https://api.github.com/users/das-g/received_events","type":"User","site_admin":false},"body":"```python\r\nif status_filter in allowed_status_filters:\r\n```\r\nshould suffice here. `None` can be used on the left side of containment tests just fine. (`None in [None, 2, 'three']` is `True` while `None in [1, 2, 'three']` is `False`.)","created_at":"2016-05-26T14:51:45Z","updated_at":"2016-05-26T14:51:45Z","html_url":"https://github.com/geometalab/osmaxx-frontend/pull/513#discussion_r64759679","pull_request_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/513","_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/comments/64759679"},"html":{"href":"https://github.com/geometalab/osmaxx-frontend/pull/513#discussion_r64759679"},"pull_request":{"href":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/513"}}},"pull_request":{"url":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/513","id":71547202,"html_url":"https://github.com/geometalab/osmaxx-frontend/pull/513","diff_url":"https://github.com/geometalab/osmaxx-frontend/pull/513.diff","patch_url":"https://github.com/geometalab/osmaxx-frontend/pull/513.patch","issue_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues/513","number":513,"state":"open","locked":false,"title":"Feature/#502 use timestamps on export","user":{"login":"hixi","id":97119,"avatar_url":"https://avatars.githubusercontent.com/u/97119?v=3","gravatar_id":"","url":"https://api.github.com/users/hixi","html_url":"https://github.com/hixi","followers_url":"https://api.github.com/users/hixi/followers","following_url":"https://api.github.com/users/hixi/following{/other_user}","gists_url":"https://api.github.com/users/hixi/gists{/gist_id}","starred_url":"https://api.github.com/users/hixi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hixi/subscriptions","organizations_url":"https://api.github.com/users/hixi/orgs","repos_url":"https://api.github.com/users/hixi/repos","events_url":"https://api.github.com/users/hixi/events{/privacy}","received_events_url":"https://api.github.com/users/hixi/received_events","type":"User","site_admin":false},"body":"Does abit more than requested on the issue:\r\n- uses timestamps\r\n- displays them\r\n- updates them when a file is downloaded\r\n\r\nReviewed by:\r\n\r\n- [ ] @das-g \r\n\r\nCloses #502 \r\nCloses #469","created_at":"2016-05-26T12:28:15Z","updated_at":"2016-05-26T14:51:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a516ea536443a1dfd4cdfec74966e6fdea5971f3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/513/commits","review_comments_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/513/comments","review_comment_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues/513/comments","statuses_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/statuses/9159ba5a17ff62ffb404ec775c6661d7ca87b186","head":{"label":"geometalab:feature/#502_use_timestamps_on_export","ref":"feature/#502_use_timestamps_on_export","sha":"9159ba5a17ff62ffb404ec775c6661d7ca87b186","user":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"repo":{"id":28986110,"name":"osmaxx-frontend","full_name":"geometalab/osmaxx-frontend","owner":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geometalab/osmaxx-frontend","description":"Django-based web frontend for Osmaxx project","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx-frontend","forks_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/deployments","created_at":"2015-01-08T21:05:34Z","updated_at":"2016-05-11T09:17:12Z","pushed_at":"2016-05-26T14:24:10Z","git_url":"git://github.com/geometalab/osmaxx-frontend.git","ssh_url":"git@github.com:geometalab/osmaxx-frontend.git","clone_url":"https://github.com/geometalab/osmaxx-frontend.git","svn_url":"https://github.com/geometalab/osmaxx-frontend","homepage":"http://osmaxx.hsr.ch/","size":59554,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":50,"forks":0,"open_issues":50,"watchers":2,"default_branch":"develop"}},"base":{"label":"geometalab:develop","ref":"develop","sha":"b31655e38646ced333a16608f4bf3ab64a4eaa11","user":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"repo":{"id":28986110,"name":"osmaxx-frontend","full_name":"geometalab/osmaxx-frontend","owner":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geometalab/osmaxx-frontend","description":"Django-based web frontend for Osmaxx project","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx-frontend","forks_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/geometalab/osmaxx-frontend/deployments","created_at":"2015-01-08T21:05:34Z","updated_at":"2016-05-11T09:17:12Z","pushed_at":"2016-05-26T14:24:10Z","git_url":"git://github.com/geometalab/osmaxx-frontend.git","ssh_url":"git@github.com:geometalab/osmaxx-frontend.git","clone_url":"https://github.com/geometalab/osmaxx-frontend.git","svn_url":"https://github.com/geometalab/osmaxx-frontend","homepage":"http://osmaxx.hsr.ch/","size":59554,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":50,"forks":0,"open_issues":50,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/513"},"html":{"href":"https://github.com/geometalab/osmaxx-frontend/pull/513"},"issue":{"href":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues/513"},"comments":{"href":"https://api.github.com/repos/geometalab/osmaxx-frontend/issues/513/comments"},"review_comments":{"href":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/513/comments"},"review_comment":{"href":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geometalab/osmaxx-frontend/pulls/513/commits"},"statuses":{"href":"https://api.github.com/repos/geometalab/osmaxx-frontend/statuses/9159ba5a17ff62ffb404ec775c6661d7ca87b186"}}}}
{"actor":{"display_login":"das-g"}}