{"action":"created","comment":{"url":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/comments/74117774","id":74117774,"diff_hunk":"@@ -0,0 +1,12 @@\n+from django.db import models\n+from django.contrib.postgres.fields import JSONField\n+from core.models import RandomIDModel\n+from questionnaires.models import Questionnaire\n+from accounts.models import User\n+\n+\n+class XFormSubmission(RandomIDModel):\n+    json_submission = JSONField(default={}, null=False)\n+    user = models.ForeignKey(User, related_name='submission', null=False)","path":"cadasta/xforms/models.py","position":10,"original_position":10,"commit_id":"86c647e445b828117f2b0f154ab4046f725ec507","original_commit_id":"86c647e445b828117f2b0f154ab4046f725ec507","user":{"login":"linzjax","id":8128188,"avatar_url":"https://avatars.githubusercontent.com/u/8128188?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjax","html_url":"https://github.com/linzjax","followers_url":"https://api.github.com/users/linzjax/followers","following_url":"https://api.github.com/users/linzjax/following{/other_user}","gists_url":"https://api.github.com/users/linzjax/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjax/subscriptions","organizations_url":"https://api.github.com/users/linzjax/orgs","repos_url":"https://api.github.com/users/linzjax/repos","events_url":"https://api.github.com/users/linzjax/events{/privacy}","received_events_url":"https://api.github.com/users/linzjax/received_events","type":"User","site_admin":false},"body":"Seems reasonable to me.","created_at":"2016-08-09T18:31:50Z","updated_at":"2016-08-09T18:31:50Z","html_url":"https://github.com/Cadasta/cadasta-platform/pull/540#discussion_r74117774","pull_request_url":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/540","_links":{"self":{"href":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/comments/74117774"},"html":{"href":"https://github.com/Cadasta/cadasta-platform/pull/540#discussion_r74117774"},"pull_request":{"href":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/540"}}},"pull_request":{"url":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/540","id":80642980,"html_url":"https://github.com/Cadasta/cadasta-platform/pull/540","diff_url":"https://github.com/Cadasta/cadasta-platform/pull/540.diff","patch_url":"https://github.com/Cadasta/cadasta-platform/pull/540.patch","issue_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/540","number":540,"state":"open","locked":false,"title":" Fixes for #422: Added model for xform","user":{"login":"linzjax","id":8128188,"avatar_url":"https://avatars.githubusercontent.com/u/8128188?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjax","html_url":"https://github.com/linzjax","followers_url":"https://api.github.com/users/linzjax/followers","following_url":"https://api.github.com/users/linzjax/following{/other_user}","gists_url":"https://api.github.com/users/linzjax/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjax/subscriptions","organizations_url":"https://api.github.com/users/linzjax/orgs","repos_url":"https://api.github.com/users/linzjax/repos","events_url":"https://api.github.com/users/linzjax/events{/privacy}","received_events_url":"https://api.github.com/users/linzjax/received_events","type":"User","site_admin":false},"body":"### Proposed changes in this pull request\r\n- Fixes #442 by adding a model to collect the full xform responses submitted by geoodk collect.\r\n- Refactored model_helper to improve readability, and package all database transactions together.\r\n- Caught and fixed bug in resource creation to ensure that only approved file types are allowed.\r\n- Includes beginnings of @bjohare 's work on Questionnaire selection, and improved error messaging.\r\n\r\n### When should this PR be merged\r\n\r\nBefore @bjohare's PR to maximize his fun.\r\n\r\n### Risks\r\n\r\n- None. Error messaging is still an issue only because we can't customize Collect, but it's better.\r\n\r\n### Follow up actions\r\n\r\n- New 001_initial.py for the xform model.\r\n- Update Quesitonnaire Creation documentation to include option of letting the user choose between geoshape and geotrace.\r\n","created_at":"2016-08-09T15:35:05Z","updated_at":"2016-08-09T18:31:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ca4e94a614986df77298d7e43a0a43f3268e363","assignee":{"login":"bjohare","id":3308136,"avatar_url":"https://avatars.githubusercontent.com/u/3308136?v=3","gravatar_id":"","url":"https://api.github.com/users/bjohare","html_url":"https://github.com/bjohare","followers_url":"https://api.github.com/users/bjohare/followers","following_url":"https://api.github.com/users/bjohare/following{/other_user}","gists_url":"https://api.github.com/users/bjohare/gists{/gist_id}","starred_url":"https://api.github.com/users/bjohare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjohare/subscriptions","organizations_url":"https://api.github.com/users/bjohare/orgs","repos_url":"https://api.github.com/users/bjohare/repos","events_url":"https://api.github.com/users/bjohare/events{/privacy}","received_events_url":"https://api.github.com/users/bjohare/received_events","type":"User","site_admin":false},"assignees":[{"login":"bjohare","id":3308136,"avatar_url":"https://avatars.githubusercontent.com/u/3308136?v=3","gravatar_id":"","url":"https://api.github.com/users/bjohare","html_url":"https://github.com/bjohare","followers_url":"https://api.github.com/users/bjohare/followers","following_url":"https://api.github.com/users/bjohare/following{/other_user}","gists_url":"https://api.github.com/users/bjohare/gists{/gist_id}","starred_url":"https://api.github.com/users/bjohare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjohare/subscriptions","organizations_url":"https://api.github.com/users/bjohare/orgs","repos_url":"https://api.github.com/users/bjohare/repos","events_url":"https://api.github.com/users/bjohare/events{/privacy}","received_events_url":"https://api.github.com/users/bjohare/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/540/commits","review_comments_url":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/540/comments","review_comment_url":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/540/comments","statuses_url":"https://api.github.com/repos/Cadasta/cadasta-platform/statuses/86c647e445b828117f2b0f154ab4046f725ec507","head":{"label":"Cadasta:feature/xform-model","ref":"feature/xform-model","sha":"86c647e445b828117f2b0f154ab4046f725ec507","user":{"login":"Cadasta","id":11321107,"avatar_url":"https://avatars.githubusercontent.com/u/11321107?v=3","gravatar_id":"","url":"https://api.github.com/users/Cadasta","html_url":"https://github.com/Cadasta","followers_url":"https://api.github.com/users/Cadasta/followers","following_url":"https://api.github.com/users/Cadasta/following{/other_user}","gists_url":"https://api.github.com/users/Cadasta/gists{/gist_id}","starred_url":"https://api.github.com/users/Cadasta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cadasta/subscriptions","organizations_url":"https://api.github.com/users/Cadasta/orgs","repos_url":"https://api.github.com/users/Cadasta/repos","events_url":"https://api.github.com/users/Cadasta/events{/privacy}","received_events_url":"https://api.github.com/users/Cadasta/received_events","type":"Organization","site_admin":false},"repo":{"id":45993428,"name":"cadasta-platform","full_name":"Cadasta/cadasta-platform","owner":{"login":"Cadasta","id":11321107,"avatar_url":"https://avatars.githubusercontent.com/u/11321107?v=3","gravatar_id":"","url":"https://api.github.com/users/Cadasta","html_url":"https://github.com/Cadasta","followers_url":"https://api.github.com/users/Cadasta/followers","following_url":"https://api.github.com/users/Cadasta/following{/other_user}","gists_url":"https://api.github.com/users/Cadasta/gists{/gist_id}","starred_url":"https://api.github.com/users/Cadasta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cadasta/subscriptions","organizations_url":"https://api.github.com/users/Cadasta/orgs","repos_url":"https://api.github.com/users/Cadasta/repos","events_url":"https://api.github.com/users/Cadasta/events{/privacy}","received_events_url":"https://api.github.com/users/Cadasta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cadasta/cadasta-platform","description":null,"fork":false,"url":"https://api.github.com/repos/Cadasta/cadasta-platform","forks_url":"https://api.github.com/repos/Cadasta/cadasta-platform/forks","keys_url":"https://api.github.com/repos/Cadasta/cadasta-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cadasta/cadasta-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cadasta/cadasta-platform/teams","hooks_url":"https://api.github.com/repos/Cadasta/cadasta-platform/hooks","issue_events_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/events{/number}","events_url":"https://api.github.com/repos/Cadasta/cadasta-platform/events","assignees_url":"https://api.github.com/repos/Cadasta/cadasta-platform/assignees{/user}","branches_url":"https://api.github.com/repos/Cadasta/cadasta-platform/branches{/branch}","tags_url":"https://api.github.com/repos/Cadasta/cadasta-platform/tags","blobs_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cadasta/cadasta-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/Cadasta/cadasta-platform/languages","stargazers_url":"https://api.github.com/repos/Cadasta/cadasta-platform/stargazers","contributors_url":"https://api.github.com/repos/Cadasta/cadasta-platform/contributors","subscribers_url":"https://api.github.com/repos/Cadasta/cadasta-platform/subscribers","subscription_url":"https://api.github.com/repos/Cadasta/cadasta-platform/subscription","commits_url":"https://api.github.com/repos/Cadasta/cadasta-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cadasta/cadasta-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cadasta/cadasta-platform/contents/{+path}","compare_url":"https://api.github.com/repos/Cadasta/cadasta-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cadasta/cadasta-platform/merges","archive_url":"https://api.github.com/repos/Cadasta/cadasta-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cadasta/cadasta-platform/downloads","issues_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues{/number}","pulls_url":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/Cadasta/cadasta-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/Cadasta/cadasta-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cadasta/cadasta-platform/labels{/name}","releases_url":"https://api.github.com/repos/Cadasta/cadasta-platform/releases{/id}","deployments_url":"https://api.github.com/repos/Cadasta/cadasta-platform/deployments","created_at":"2015-11-11T16:26:25Z","updated_at":"2016-07-14T18:31:49Z","pushed_at":"2016-08-09T18:04:12Z","git_url":"git://github.com/Cadasta/cadasta-platform.git","ssh_url":"git@github.com:Cadasta/cadasta-platform.git","clone_url":"https://github.com/Cadasta/cadasta-platform.git","svn_url":"https://github.com/Cadasta/cadasta-platform","homepage":null,"size":3945,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":83,"forks":1,"open_issues":83,"watchers":8,"default_branch":"master"}},"base":{"label":"Cadasta:master","ref":"master","sha":"2ca9ca0c668eff9d39915c9b75b1607f7ae70b01","user":{"login":"Cadasta","id":11321107,"avatar_url":"https://avatars.githubusercontent.com/u/11321107?v=3","gravatar_id":"","url":"https://api.github.com/users/Cadasta","html_url":"https://github.com/Cadasta","followers_url":"https://api.github.com/users/Cadasta/followers","following_url":"https://api.github.com/users/Cadasta/following{/other_user}","gists_url":"https://api.github.com/users/Cadasta/gists{/gist_id}","starred_url":"https://api.github.com/users/Cadasta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cadasta/subscriptions","organizations_url":"https://api.github.com/users/Cadasta/orgs","repos_url":"https://api.github.com/users/Cadasta/repos","events_url":"https://api.github.com/users/Cadasta/events{/privacy}","received_events_url":"https://api.github.com/users/Cadasta/received_events","type":"Organization","site_admin":false},"repo":{"id":45993428,"name":"cadasta-platform","full_name":"Cadasta/cadasta-platform","owner":{"login":"Cadasta","id":11321107,"avatar_url":"https://avatars.githubusercontent.com/u/11321107?v=3","gravatar_id":"","url":"https://api.github.com/users/Cadasta","html_url":"https://github.com/Cadasta","followers_url":"https://api.github.com/users/Cadasta/followers","following_url":"https://api.github.com/users/Cadasta/following{/other_user}","gists_url":"https://api.github.com/users/Cadasta/gists{/gist_id}","starred_url":"https://api.github.com/users/Cadasta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cadasta/subscriptions","organizations_url":"https://api.github.com/users/Cadasta/orgs","repos_url":"https://api.github.com/users/Cadasta/repos","events_url":"https://api.github.com/users/Cadasta/events{/privacy}","received_events_url":"https://api.github.com/users/Cadasta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cadasta/cadasta-platform","description":null,"fork":false,"url":"https://api.github.com/repos/Cadasta/cadasta-platform","forks_url":"https://api.github.com/repos/Cadasta/cadasta-platform/forks","keys_url":"https://api.github.com/repos/Cadasta/cadasta-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cadasta/cadasta-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cadasta/cadasta-platform/teams","hooks_url":"https://api.github.com/repos/Cadasta/cadasta-platform/hooks","issue_events_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/events{/number}","events_url":"https://api.github.com/repos/Cadasta/cadasta-platform/events","assignees_url":"https://api.github.com/repos/Cadasta/cadasta-platform/assignees{/user}","branches_url":"https://api.github.com/repos/Cadasta/cadasta-platform/branches{/branch}","tags_url":"https://api.github.com/repos/Cadasta/cadasta-platform/tags","blobs_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cadasta/cadasta-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/Cadasta/cadasta-platform/languages","stargazers_url":"https://api.github.com/repos/Cadasta/cadasta-platform/stargazers","contributors_url":"https://api.github.com/repos/Cadasta/cadasta-platform/contributors","subscribers_url":"https://api.github.com/repos/Cadasta/cadasta-platform/subscribers","subscription_url":"https://api.github.com/repos/Cadasta/cadasta-platform/subscription","commits_url":"https://api.github.com/repos/Cadasta/cadasta-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cadasta/cadasta-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cadasta/cadasta-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cadasta/cadasta-platform/contents/{+path}","compare_url":"https://api.github.com/repos/Cadasta/cadasta-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cadasta/cadasta-platform/merges","archive_url":"https://api.github.com/repos/Cadasta/cadasta-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cadasta/cadasta-platform/downloads","issues_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues{/number}","pulls_url":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/Cadasta/cadasta-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/Cadasta/cadasta-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cadasta/cadasta-platform/labels{/name}","releases_url":"https://api.github.com/repos/Cadasta/cadasta-platform/releases{/id}","deployments_url":"https://api.github.com/repos/Cadasta/cadasta-platform/deployments","created_at":"2015-11-11T16:26:25Z","updated_at":"2016-07-14T18:31:49Z","pushed_at":"2016-08-09T18:04:12Z","git_url":"git://github.com/Cadasta/cadasta-platform.git","ssh_url":"git@github.com:Cadasta/cadasta-platform.git","clone_url":"https://github.com/Cadasta/cadasta-platform.git","svn_url":"https://github.com/Cadasta/cadasta-platform","homepage":null,"size":3945,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":83,"forks":1,"open_issues":83,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/540"},"html":{"href":"https://github.com/Cadasta/cadasta-platform/pull/540"},"issue":{"href":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/540"},"comments":{"href":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/540/comments"},"review_comments":{"href":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/540/comments"},"review_comment":{"href":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cadasta/cadasta-platform/pulls/540/commits"},"statuses":{"href":"https://api.github.com/repos/Cadasta/cadasta-platform/statuses/86c647e445b828117f2b0f154ab4046f725ec507"}}}}
{"actor":{"display_login":"linzjax"}}