{"action":"created","comment":{"url":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/comments/29128118","id":29128118,"diff_hunk":"@@ -28,6 +31,41 @@ class IsoDateTimeFilter(django_filters.DateTimeFilter):\n     field_class = IsoDateTimeField\n \n \n+class TimeRangeFilter(django_filters.filters.Filter):\n+    \"\"\"\n+    Filters a queryset based on the number of days needed. eg a week, a month\n+    or a quater (3 months)\n+\n+    It is a very naive implimentation as it does not cater for the fact that\n+    months do not have equal number of days\n+    \"\"\"\n+\n+    def __init__(self, *args, **kwargs):\n+        self.alias = kwargs.get('alias')\n+        self.last_one_week = True if self.alias == 'last_one_week' else False\n+        self.last_one_quater = True if self.alias == 'last_one_quater' \\","path":"common/filters/filter_shared.py","position":28,"original_position":28,"commit_id":"344295b11242f8e66d5baa0c78cc0a4be56a0f2a","original_commit_id":"344295b11242f8e66d5baa0c78cc0a4be56a0f2a","user":{"login":"ngurenyaga","id":220600,"avatar_url":"https://avatars.githubusercontent.com/u/220600?v=3","gravatar_id":"","url":"https://api.github.com/users/ngurenyaga","html_url":"https://github.com/ngurenyaga","followers_url":"https://api.github.com/users/ngurenyaga/followers","following_url":"https://api.github.com/users/ngurenyaga/following{/other_user}","gists_url":"https://api.github.com/users/ngurenyaga/gists{/gist_id}","starred_url":"https://api.github.com/users/ngurenyaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngurenyaga/subscriptions","organizations_url":"https://api.github.com/users/ngurenyaga/orgs","repos_url":"https://api.github.com/users/ngurenyaga/repos","events_url":"https://api.github.com/users/ngurenyaga/events{/privacy}","received_events_url":"https://api.github.com/users/ngurenyaga/received_events","type":"User","site_admin":false},"body":"Typo; quarter, not quater","created_at":"2015-04-27T08:25:02Z","updated_at":"2015-04-27T08:25:02Z","html_url":"https://github.com/MasterFacilityList/mfl_api/pull/124#discussion_r29128118","pull_request_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/124","_links":{"self":{"href":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/comments/29128118"},"html":{"href":"https://github.com/MasterFacilityList/mfl_api/pull/124#discussion_r29128118"},"pull_request":{"href":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/124"}}},"pull_request":{"url":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/124","id":34064087,"html_url":"https://github.com/MasterFacilityList/mfl_api/pull/124","diff_url":"https://github.com/MasterFacilityList/mfl_api/pull/124.diff","patch_url":"https://github.com/MasterFacilityList/mfl_api/pull/124.patch","issue_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues/124","number":124,"state":"open","locked":false,"title":"Add filters for last one week,  one month and last one quater","user":{"login":"bmarika","id":6511753,"avatar_url":"https://avatars.githubusercontent.com/u/6511753?v=3","gravatar_id":"","url":"https://api.github.com/users/bmarika","html_url":"https://github.com/bmarika","followers_url":"https://api.github.com/users/bmarika/followers","following_url":"https://api.github.com/users/bmarika/following{/other_user}","gists_url":"https://api.github.com/users/bmarika/gists{/gist_id}","starred_url":"https://api.github.com/users/bmarika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmarika/subscriptions","organizations_url":"https://api.github.com/users/bmarika/orgs","repos_url":"https://api.github.com/users/bmarika/repos","events_url":"https://api.github.com/users/bmarika/events{/privacy}","received_events_url":"https://api.github.com/users/bmarika/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-24T16:27:07Z","updated_at":"2015-04-27T08:25:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74637b842798e34bc34c3a083bb13fb90928273e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/124/commits","review_comments_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/124/comments","review_comment_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues/124/comments","statuses_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/statuses/344295b11242f8e66d5baa0c78cc0a4be56a0f2a","head":{"label":"MasterFacilityList:recently_approved_facilities_filter","ref":"recently_approved_facilities_filter","sha":"344295b11242f8e66d5baa0c78cc0a4be56a0f2a","user":{"login":"MasterFacilityList","id":11611058,"avatar_url":"https://avatars.githubusercontent.com/u/11611058?v=3","gravatar_id":"","url":"https://api.github.com/users/MasterFacilityList","html_url":"https://github.com/MasterFacilityList","followers_url":"https://api.github.com/users/MasterFacilityList/followers","following_url":"https://api.github.com/users/MasterFacilityList/following{/other_user}","gists_url":"https://api.github.com/users/MasterFacilityList/gists{/gist_id}","starred_url":"https://api.github.com/users/MasterFacilityList/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MasterFacilityList/subscriptions","organizations_url":"https://api.github.com/users/MasterFacilityList/orgs","repos_url":"https://api.github.com/users/MasterFacilityList/repos","events_url":"https://api.github.com/users/MasterFacilityList/events{/privacy}","received_events_url":"https://api.github.com/users/MasterFacilityList/received_events","type":"Organization","site_admin":false},"repo":{"id":32854024,"name":"mfl_api","full_name":"MasterFacilityList/mfl_api","owner":{"login":"MasterFacilityList","id":11611058,"avatar_url":"https://avatars.githubusercontent.com/u/11611058?v=3","gravatar_id":"","url":"https://api.github.com/users/MasterFacilityList","html_url":"https://github.com/MasterFacilityList","followers_url":"https://api.github.com/users/MasterFacilityList/followers","following_url":"https://api.github.com/users/MasterFacilityList/following{/other_user}","gists_url":"https://api.github.com/users/MasterFacilityList/gists{/gist_id}","starred_url":"https://api.github.com/users/MasterFacilityList/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MasterFacilityList/subscriptions","organizations_url":"https://api.github.com/users/MasterFacilityList/orgs","repos_url":"https://api.github.com/users/MasterFacilityList/repos","events_url":"https://api.github.com/users/MasterFacilityList/events{/privacy}","received_events_url":"https://api.github.com/users/MasterFacilityList/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MasterFacilityList/mfl_api","description":"The Master Facilty List, Ministry of Health Kenya","fork":false,"url":"https://api.github.com/repos/MasterFacilityList/mfl_api","forks_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/forks","keys_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/teams","hooks_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/hooks","issue_events_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues/events{/number}","events_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/events","assignees_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/assignees{/user}","branches_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/branches{/branch}","tags_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/tags","blobs_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/refs{/sha}","trees_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/statuses/{sha}","languages_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/languages","stargazers_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/stargazers","contributors_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/contributors","subscribers_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/subscribers","subscription_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/subscription","commits_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/commits{/sha}","git_commits_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/commits{/sha}","comments_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/comments{/number}","issue_comment_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues/comments{/number}","contents_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/contents/{+path}","compare_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/merges","archive_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/downloads","issues_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues{/number}","pulls_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls{/number}","milestones_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/milestones{/number}","notifications_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/labels{/name}","releases_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/releases{/id}","created_at":"2015-03-25T09:14:34Z","updated_at":"2015-04-24T13:16:31Z","pushed_at":"2015-04-27T08:16:13Z","git_url":"git://github.com/MasterFacilityList/mfl_api.git","ssh_url":"git@github.com:MasterFacilityList/mfl_api.git","clone_url":"https://github.com/MasterFacilityList/mfl_api.git","svn_url":"https://github.com/MasterFacilityList/mfl_api","homepage":"https://www.ehealth.or.ke","size":2357,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":12,"forks":2,"open_issues":12,"watchers":1,"default_branch":"develop"}},"base":{"label":"MasterFacilityList:develop","ref":"develop","sha":"bb1e15bb01d87807406b44b9edaa226ca2787c61","user":{"login":"MasterFacilityList","id":11611058,"avatar_url":"https://avatars.githubusercontent.com/u/11611058?v=3","gravatar_id":"","url":"https://api.github.com/users/MasterFacilityList","html_url":"https://github.com/MasterFacilityList","followers_url":"https://api.github.com/users/MasterFacilityList/followers","following_url":"https://api.github.com/users/MasterFacilityList/following{/other_user}","gists_url":"https://api.github.com/users/MasterFacilityList/gists{/gist_id}","starred_url":"https://api.github.com/users/MasterFacilityList/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MasterFacilityList/subscriptions","organizations_url":"https://api.github.com/users/MasterFacilityList/orgs","repos_url":"https://api.github.com/users/MasterFacilityList/repos","events_url":"https://api.github.com/users/MasterFacilityList/events{/privacy}","received_events_url":"https://api.github.com/users/MasterFacilityList/received_events","type":"Organization","site_admin":false},"repo":{"id":32854024,"name":"mfl_api","full_name":"MasterFacilityList/mfl_api","owner":{"login":"MasterFacilityList","id":11611058,"avatar_url":"https://avatars.githubusercontent.com/u/11611058?v=3","gravatar_id":"","url":"https://api.github.com/users/MasterFacilityList","html_url":"https://github.com/MasterFacilityList","followers_url":"https://api.github.com/users/MasterFacilityList/followers","following_url":"https://api.github.com/users/MasterFacilityList/following{/other_user}","gists_url":"https://api.github.com/users/MasterFacilityList/gists{/gist_id}","starred_url":"https://api.github.com/users/MasterFacilityList/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MasterFacilityList/subscriptions","organizations_url":"https://api.github.com/users/MasterFacilityList/orgs","repos_url":"https://api.github.com/users/MasterFacilityList/repos","events_url":"https://api.github.com/users/MasterFacilityList/events{/privacy}","received_events_url":"https://api.github.com/users/MasterFacilityList/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MasterFacilityList/mfl_api","description":"The Master Facilty List, Ministry of Health Kenya","fork":false,"url":"https://api.github.com/repos/MasterFacilityList/mfl_api","forks_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/forks","keys_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/teams","hooks_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/hooks","issue_events_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues/events{/number}","events_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/events","assignees_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/assignees{/user}","branches_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/branches{/branch}","tags_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/tags","blobs_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/refs{/sha}","trees_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/statuses/{sha}","languages_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/languages","stargazers_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/stargazers","contributors_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/contributors","subscribers_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/subscribers","subscription_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/subscription","commits_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/commits{/sha}","git_commits_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/git/commits{/sha}","comments_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/comments{/number}","issue_comment_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues/comments{/number}","contents_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/contents/{+path}","compare_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/merges","archive_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/downloads","issues_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues{/number}","pulls_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls{/number}","milestones_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/milestones{/number}","notifications_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/labels{/name}","releases_url":"https://api.github.com/repos/MasterFacilityList/mfl_api/releases{/id}","created_at":"2015-03-25T09:14:34Z","updated_at":"2015-04-24T13:16:31Z","pushed_at":"2015-04-27T08:16:13Z","git_url":"git://github.com/MasterFacilityList/mfl_api.git","ssh_url":"git@github.com:MasterFacilityList/mfl_api.git","clone_url":"https://github.com/MasterFacilityList/mfl_api.git","svn_url":"https://github.com/MasterFacilityList/mfl_api","homepage":"https://www.ehealth.or.ke","size":2357,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":12,"forks":2,"open_issues":12,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/124"},"html":{"href":"https://github.com/MasterFacilityList/mfl_api/pull/124"},"issue":{"href":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues/124"},"comments":{"href":"https://api.github.com/repos/MasterFacilityList/mfl_api/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MasterFacilityList/mfl_api/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/MasterFacilityList/mfl_api/statuses/344295b11242f8e66d5baa0c78cc0a4be56a0f2a"}}}}