{"action":"created","comment":{"url":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments/40204147","id":40204147,"diff_hunk":"@@ -0,0 +1,34 @@\n+from django.shortcuts import _get_queryset\n+\n+\n+def get_object_or_none(klass, *args, **kwargs):\n+    \"\"\"\n+    Uses get() to return an object, or None if the object\n+    does not exist.\n+\n+    klass may be a Model, Manager, or QuerySet object. All other passed\n+    arguments and keyword arguments are used in the get() query.\n+\n+    Note: Like with get(), an MultipleObjectsReturned will be raised if more than one\n+    object is found.\n+    \"\"\"\n+    queryset = _get_queryset(klass)\n+    try:\n+        return queryset.get(*args, **kwargs)\n+    except queryset.model.DoesNotExist:\n+        return None\n+\n+\n+def get_list_or_none(klass, *args, **kwargs):\n+    \"\"\"\n+    Uses filter() to return a list of objects, or raise a Http404 exception if","path":"osmaxx-py/osmaxx/utilities/shortcuts.py","position":24,"original_position":24,"commit_id":"21a663d98d9e49121a86b330b08c740828b364cf","original_commit_id":"21a663d98d9e49121a86b330b08c740828b364cf","user":{"login":"wasabideveloper","id":10944699,"avatar_url":"https://avatars.githubusercontent.com/u/10944699?v=3","gravatar_id":"","url":"https://api.github.com/users/wasabideveloper","html_url":"https://github.com/wasabideveloper","followers_url":"https://api.github.com/users/wasabideveloper/followers","following_url":"https://api.github.com/users/wasabideveloper/following{/other_user}","gists_url":"https://api.github.com/users/wasabideveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/wasabideveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasabideveloper/subscriptions","organizations_url":"https://api.github.com/users/wasabideveloper/orgs","repos_url":"https://api.github.com/users/wasabideveloper/repos","events_url":"https://api.github.com/users/wasabideveloper/events{/privacy}","received_events_url":"https://api.github.com/users/wasabideveloper/received_events","type":"User","site_admin":false},"body":":heavy_check_mark: ","created_at":"2015-09-23T13:45:58Z","updated_at":"2015-09-23T13:45:58Z","html_url":"https://github.com/geometalab/osmaxx/pull/204#discussion_r40204147","pull_request_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/204","_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments/40204147"},"html":{"href":"https://github.com/geometalab/osmaxx/pull/204#discussion_r40204147"},"pull_request":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/204"}}},"pull_request":{"url":"https://api.github.com/repos/geometalab/osmaxx/pulls/204","id":45774915,"html_url":"https://github.com/geometalab/osmaxx/pull/204","diff_url":"https://github.com/geometalab/osmaxx/pull/204.diff","patch_url":"https://github.com/geometalab/osmaxx/pull/204.patch","issue_url":"https://api.github.com/repos/geometalab/osmaxx/issues/204","number":204,"state":"open","locked":false,"title":"Feature/203 add utility shortcut functions","user":{"login":"njordan-hsr","id":8830664,"avatar_url":"https://avatars.githubusercontent.com/u/8830664?v=3","gravatar_id":"","url":"https://api.github.com/users/njordan-hsr","html_url":"https://github.com/njordan-hsr","followers_url":"https://api.github.com/users/njordan-hsr/followers","following_url":"https://api.github.com/users/njordan-hsr/following{/other_user}","gists_url":"https://api.github.com/users/njordan-hsr/gists{/gist_id}","starred_url":"https://api.github.com/users/njordan-hsr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njordan-hsr/subscriptions","organizations_url":"https://api.github.com/users/njordan-hsr/orgs","repos_url":"https://api.github.com/users/njordan-hsr/repos","events_url":"https://api.github.com/users/njordan-hsr/events{/privacy}","received_events_url":"https://api.github.com/users/njordan-hsr/received_events","type":"User","site_admin":false},"body":"Closes #203.\r\n\r\n* Added tested utility functions `get_object_or_none` and `get_list_or_none`\r\n* Added a test settings file for the required test-models\r\n    * Updated test runner to reflect that\r\n* Used 10 seconds as wait time to wait until database is running\r\n\r\nRan Tests, all OK.\r\n\r\nReviewed by:\r\n* [ ] @das-g \r\n* [x] @wasabideveloper\r\n\r\n","created_at":"2015-09-23T12:51:12Z","updated_at":"2015-09-23T13:45:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfcd3c34d4f94611594c2e1e8da4b9f8e294082b","assignee":{"login":"njordan-hsr","id":8830664,"avatar_url":"https://avatars.githubusercontent.com/u/8830664?v=3","gravatar_id":"","url":"https://api.github.com/users/njordan-hsr","html_url":"https://github.com/njordan-hsr","followers_url":"https://api.github.com/users/njordan-hsr/followers","following_url":"https://api.github.com/users/njordan-hsr/following{/other_user}","gists_url":"https://api.github.com/users/njordan-hsr/gists{/gist_id}","starred_url":"https://api.github.com/users/njordan-hsr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njordan-hsr/subscriptions","organizations_url":"https://api.github.com/users/njordan-hsr/orgs","repos_url":"https://api.github.com/users/njordan-hsr/repos","events_url":"https://api.github.com/users/njordan-hsr/events{/privacy}","received_events_url":"https://api.github.com/users/njordan-hsr/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/geometalab/osmaxx/milestones/8","html_url":"https://github.com/geometalab/osmaxx/milestones/Alpha%206%20-%20Bugfixes%20&%20enhancements","labels_url":"https://api.github.com/repos/geometalab/osmaxx/milestones/8/labels","id":1257971,"number":8,"title":"Alpha 6 - Bugfixes & enhancements","description":"Feature freeze: October 21\r\n\r\n### Bugfixes\r\n\r\n* UI Bugs\r\n* Containers\r\n\r\n\r\n### Enhancements\r\n\r\n* UI\r\n* Testcoverage\r\n\r\n### Related Milestones\r\n\r\nhttps://github.com/geometalab/osmaxx-postgis-conversion/milestones/Alpha%202%20-%20Refactoring%20&%20file-gdb","creator":{"login":"wasabideveloper","id":10944699,"avatar_url":"https://avatars.githubusercontent.com/u/10944699?v=3","gravatar_id":"","url":"https://api.github.com/users/wasabideveloper","html_url":"https://github.com/wasabideveloper","followers_url":"https://api.github.com/users/wasabideveloper/followers","following_url":"https://api.github.com/users/wasabideveloper/following{/other_user}","gists_url":"https://api.github.com/users/wasabideveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/wasabideveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasabideveloper/subscriptions","organizations_url":"https://api.github.com/users/wasabideveloper/orgs","repos_url":"https://api.github.com/users/wasabideveloper/repos","events_url":"https://api.github.com/users/wasabideveloper/events{/privacy}","received_events_url":"https://api.github.com/users/wasabideveloper/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":9,"state":"open","created_at":"2015-08-17T10:18:48Z","updated_at":"2015-09-23T13:45:21Z","due_on":"2015-10-22T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/204/commits","review_comments_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/204/comments","review_comment_url":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geometalab/osmaxx/issues/204/comments","statuses_url":"https://api.github.com/repos/geometalab/osmaxx/statuses/21a663d98d9e49121a86b330b08c740828b364cf","head":{"label":"geometalab:feature/203_add_utility_shortcut_functions","ref":"feature/203_add_utility_shortcut_functions","sha":"21a663d98d9e49121a86b330b08c740828b364cf","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","full_name":"geometalab/osmaxx","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","description":"OpenStreetMap Arbitrary eXcerpt eXport (main repository)","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx","forks_url":"https://api.github.com/repos/geometalab/osmaxx/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx/releases{/id}","created_at":"2015-01-08T21:05:34Z","updated_at":"2015-07-23T00:51:48Z","pushed_at":"2015-09-23T13:45:21Z","git_url":"git://github.com/geometalab/osmaxx.git","ssh_url":"git@github.com:geometalab/osmaxx.git","clone_url":"https://github.com/geometalab/osmaxx.git","svn_url":"https://github.com/geometalab/osmaxx","homepage":"http://osmaxx.hsr.ch/","size":2676,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":44,"forks":0,"open_issues":44,"watchers":2,"default_branch":"develop"}},"base":{"label":"geometalab:develop","ref":"develop","sha":"37a4905515e057400b5abde9a9360c7cac778b9c","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","full_name":"geometalab/osmaxx","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","description":"OpenStreetMap Arbitrary eXcerpt eXport (main repository)","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx","forks_url":"https://api.github.com/repos/geometalab/osmaxx/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx/releases{/id}","created_at":"2015-01-08T21:05:34Z","updated_at":"2015-07-23T00:51:48Z","pushed_at":"2015-09-23T13:45:21Z","git_url":"git://github.com/geometalab/osmaxx.git","ssh_url":"git@github.com:geometalab/osmaxx.git","clone_url":"https://github.com/geometalab/osmaxx.git","svn_url":"https://github.com/geometalab/osmaxx","homepage":"http://osmaxx.hsr.ch/","size":2676,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":44,"forks":0,"open_issues":44,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/204"},"html":{"href":"https://github.com/geometalab/osmaxx/pull/204"},"issue":{"href":"https://api.github.com/repos/geometalab/osmaxx/issues/204"},"comments":{"href":"https://api.github.com/repos/geometalab/osmaxx/issues/204/comments"},"review_comments":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/204/comments"},"review_comment":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geometalab/osmaxx/pulls/204/commits"},"statuses":{"href":"https://api.github.com/repos/geometalab/osmaxx/statuses/21a663d98d9e49121a86b330b08c740828b364cf"}}}}