{"action":"created","issue":{"url":"https://api.github.com/repos/DemocracyClub/candidate_questions/issues/12","labels_url":"https://api.github.com/repos/DemocracyClub/candidate_questions/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/DemocracyClub/candidate_questions/issues/12/comments","events_url":"https://api.github.com/repos/DemocracyClub/candidate_questions/issues/12/events","html_url":"https://github.com/DemocracyClub/candidate_questions/pull/12","id":64751677,"number":12,"title":"Question assignment","user":{"login":"dantheta","id":398205,"avatar_url":"https://avatars.githubusercontent.com/u/398205?v=3","gravatar_id":"","url":"https://api.github.com/users/dantheta","html_url":"https://github.com/dantheta","followers_url":"https://api.github.com/users/dantheta/followers","following_url":"https://api.github.com/users/dantheta/following{/other_user}","gists_url":"https://api.github.com/users/dantheta/gists{/gist_id}","starred_url":"https://api.github.com/users/dantheta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantheta/subscriptions","organizations_url":"https://api.github.com/users/dantheta/orgs","repos_url":"https://api.github.com/users/dantheta/repos","events_url":"https://api.github.com/users/dantheta/events{/privacy}","received_events_url":"https://api.github.com/users/dantheta/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DemocracyClub/candidate_questions/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-27T12:16:12Z","updated_at":"2015-03-27T14:26:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DemocracyClub/candidate_questions/pulls/12","html_url":"https://github.com/DemocracyClub/candidate_questions/pull/12","diff_url":"https://github.com/DemocracyClub/candidate_questions/pull/12.diff","patch_url":"https://github.com/DemocracyClub/candidate_questions/pull/12.patch"},"body":"Script to populate the answers table for candidates.  Also introduces the participating flag on candidate, which could be set during their signup process.  Could look at refactoring this so that it can be run on a candidate immediately after they've signed up."},"comment":{"url":"https://api.github.com/repos/DemocracyClub/candidate_questions/issues/comments/86957170","html_url":"https://github.com/DemocracyClub/candidate_questions/pull/12#issuecomment-86957170","issue_url":"https://api.github.com/repos/DemocracyClub/candidate_questions/issues/12","id":86957170,"user":{"login":"dantheta","id":398205,"avatar_url":"https://avatars.githubusercontent.com/u/398205?v=3","gravatar_id":"","url":"https://api.github.com/users/dantheta","html_url":"https://github.com/dantheta","followers_url":"https://api.github.com/users/dantheta/followers","following_url":"https://api.github.com/users/dantheta/following{/other_user}","gists_url":"https://api.github.com/users/dantheta/gists{/gist_id}","starred_url":"https://api.github.com/users/dantheta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantheta/subscriptions","organizations_url":"https://api.github.com/users/dantheta/orgs","repos_url":"https://api.github.com/users/dantheta/repos","events_url":"https://api.github.com/users/dantheta/events{/privacy}","received_events_url":"https://api.github.com/users/dantheta/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T14:26:59Z","updated_at":"2015-03-27T14:26:59Z","body":"I should probably have prefaced this with \"I don't know very much django at all\".\r\n\r\nThe empty answers are added in their own step because new questions and candidates are being added over time.  We don't want late-arriving candidates to miss the early questions, and we don't want questions to go unanswered just because they didn't exist when the candidates are active.  It seemed fairly straightforward to maintain a fixed-size set of open questions against each candidate and fill that set with unanswered questions when candidates arrive or as questions are added.  As I mentioned in the earlier message, this could be rearranged so that the webapp can set up open questions for new candidates at an arbitrary point in time.\r\n\r\nThe ORM one was difficult - I new the exact SQL that I was after, but a considerable amount of googling and manual reading didn't yield anything that worked.  I couldn't get the ORM to add the candidate clause to the join condition.  If you've got an example I can look at, that'd be great.\r\n\r\nThe migrations should be OK too.  Tests might take a little longer.  How do you want database tests to work?  Is it OK for them to write to an actual database, or do you want mock objects?\r\n\r\n"}}