{"action":"opened","number":96,"pull_request":{"url":"https://api.github.com/repos/romgar/django-dirtyfields/pulls/96","id":100559726,"html_url":"https://github.com/romgar/django-dirtyfields/pull/96","diff_url":"https://github.com/romgar/django-dirtyfields/pull/96.diff","patch_url":"https://github.com/romgar/django-dirtyfields/pull/96.patch","issue_url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/96","number":96,"state":"open","locked":false,"title":"Use attname on foreign key fields","user":{"login":"zaius","id":48593,"avatar_url":"https://avatars.githubusercontent.com/u/48593?v=3","gravatar_id":"","url":"https://api.github.com/users/zaius","html_url":"https://github.com/zaius","followers_url":"https://api.github.com/users/zaius/followers","following_url":"https://api.github.com/users/zaius/following{/other_user}","gists_url":"https://api.github.com/users/zaius/gists{/gist_id}","starred_url":"https://api.github.com/users/zaius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaius/subscriptions","organizations_url":"https://api.github.com/users/zaius/orgs","repos_url":"https://api.github.com/users/zaius/repos","events_url":"https://api.github.com/users/zaius/events{/privacy}","received_events_url":"https://api.github.com/users/zaius/received_events","type":"User","site_admin":false},"body":"I was consistently hitting an error when re-saving an existing object on django 1.10. Specifically I was getting a KeyError at https://github.com/romgar/django-dirtyfields/blob/develop/src/dirtyfields/dirtyfields.py#L127 - new_state had the foreign key object name (e.g. `post`), but original_state had the foreign key _id field (e.g. `post_id`)\r\n\r\nI hit this when updating an app to django 1.10, but I'm surprised no one else has run into this, so it's quite possible it's a local error only. I thought it would be nice to document it at least. I think it may be related to the issue seen in #37","created_at":"2017-01-07T05:57:41Z","updated_at":"2017-01-07T05:57:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/romgar/django-dirtyfields/pulls/96/commits","review_comments_url":"https://api.github.com/repos/romgar/django-dirtyfields/pulls/96/comments","review_comment_url":"https://api.github.com/repos/romgar/django-dirtyfields/pulls/comments{/number}","comments_url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/96/comments","statuses_url":"https://api.github.com/repos/romgar/django-dirtyfields/statuses/53c65fb170c38a111b26f42a8d588b1d50bfa8fd","head":{"label":"1024inc:develop","ref":"develop","sha":"53c65fb170c38a111b26f42a8d588b1d50bfa8fd","user":{"login":"1024inc","id":7811265,"avatar_url":"https://avatars.githubusercontent.com/u/7811265?v=3","gravatar_id":"","url":"https://api.github.com/users/1024inc","html_url":"https://github.com/1024inc","followers_url":"https://api.github.com/users/1024inc/followers","following_url":"https://api.github.com/users/1024inc/following{/other_user}","gists_url":"https://api.github.com/users/1024inc/gists{/gist_id}","starred_url":"https://api.github.com/users/1024inc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1024inc/subscriptions","organizations_url":"https://api.github.com/users/1024inc/orgs","repos_url":"https://api.github.com/users/1024inc/repos","events_url":"https://api.github.com/users/1024inc/events{/privacy}","received_events_url":"https://api.github.com/users/1024inc/received_events","type":"Organization","site_admin":false},"repo":{"id":78260979,"name":"django-dirtyfields","full_name":"1024inc/django-dirtyfields","owner":{"login":"1024inc","id":7811265,"avatar_url":"https://avatars.githubusercontent.com/u/7811265?v=3","gravatar_id":"","url":"https://api.github.com/users/1024inc","html_url":"https://github.com/1024inc","followers_url":"https://api.github.com/users/1024inc/followers","following_url":"https://api.github.com/users/1024inc/following{/other_user}","gists_url":"https://api.github.com/users/1024inc/gists{/gist_id}","starred_url":"https://api.github.com/users/1024inc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1024inc/subscriptions","organizations_url":"https://api.github.com/users/1024inc/orgs","repos_url":"https://api.github.com/users/1024inc/repos","events_url":"https://api.github.com/users/1024inc/events{/privacy}","received_events_url":"https://api.github.com/users/1024inc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/1024inc/django-dirtyfields","description":"Tracking dirty fields on a Django model","fork":true,"url":"https://api.github.com/repos/1024inc/django-dirtyfields","forks_url":"https://api.github.com/repos/1024inc/django-dirtyfields/forks","keys_url":"https://api.github.com/repos/1024inc/django-dirtyfields/keys{/key_id}","collaborators_url":"https://api.github.com/repos/1024inc/django-dirtyfields/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/1024inc/django-dirtyfields/teams","hooks_url":"https://api.github.com/repos/1024inc/django-dirtyfields/hooks","issue_events_url":"https://api.github.com/repos/1024inc/django-dirtyfields/issues/events{/number}","events_url":"https://api.github.com/repos/1024inc/django-dirtyfields/events","assignees_url":"https://api.github.com/repos/1024inc/django-dirtyfields/assignees{/user}","branches_url":"https://api.github.com/repos/1024inc/django-dirtyfields/branches{/branch}","tags_url":"https://api.github.com/repos/1024inc/django-dirtyfields/tags","blobs_url":"https://api.github.com/repos/1024inc/django-dirtyfields/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/1024inc/django-dirtyfields/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/1024inc/django-dirtyfields/git/refs{/sha}","trees_url":"https://api.github.com/repos/1024inc/django-dirtyfields/git/trees{/sha}","statuses_url":"https://api.github.com/repos/1024inc/django-dirtyfields/statuses/{sha}","languages_url":"https://api.github.com/repos/1024inc/django-dirtyfields/languages","stargazers_url":"https://api.github.com/repos/1024inc/django-dirtyfields/stargazers","contributors_url":"https://api.github.com/repos/1024inc/django-dirtyfields/contributors","subscribers_url":"https://api.github.com/repos/1024inc/django-dirtyfields/subscribers","subscription_url":"https://api.github.com/repos/1024inc/django-dirtyfields/subscription","commits_url":"https://api.github.com/repos/1024inc/django-dirtyfields/commits{/sha}","git_commits_url":"https://api.github.com/repos/1024inc/django-dirtyfields/git/commits{/sha}","comments_url":"https://api.github.com/repos/1024inc/django-dirtyfields/comments{/number}","issue_comment_url":"https://api.github.com/repos/1024inc/django-dirtyfields/issues/comments{/number}","contents_url":"https://api.github.com/repos/1024inc/django-dirtyfields/contents/{+path}","compare_url":"https://api.github.com/repos/1024inc/django-dirtyfields/compare/{base}...{head}","merges_url":"https://api.github.com/repos/1024inc/django-dirtyfields/merges","archive_url":"https://api.github.com/repos/1024inc/django-dirtyfields/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/1024inc/django-dirtyfields/downloads","issues_url":"https://api.github.com/repos/1024inc/django-dirtyfields/issues{/number}","pulls_url":"https://api.github.com/repos/1024inc/django-dirtyfields/pulls{/number}","milestones_url":"https://api.github.com/repos/1024inc/django-dirtyfields/milestones{/number}","notifications_url":"https://api.github.com/repos/1024inc/django-dirtyfields/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/1024inc/django-dirtyfields/labels{/name}","releases_url":"https://api.github.com/repos/1024inc/django-dirtyfields/releases{/id}","deployments_url":"https://api.github.com/repos/1024inc/django-dirtyfields/deployments","created_at":"2017-01-07T05:39:13Z","updated_at":"2017-01-07T05:39:15Z","pushed_at":"2017-01-07T05:41:09Z","git_url":"git://github.com/1024inc/django-dirtyfields.git","ssh_url":"git@github.com:1024inc/django-dirtyfields.git","clone_url":"https://github.com/1024inc/django-dirtyfields.git","svn_url":"https://github.com/1024inc/django-dirtyfields","homepage":"","size":225,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"romgar:develop","ref":"develop","sha":"fc18e3b4e60de59057ab1b6a5131d7473b97c04b","user":{"login":"romgar","id":2834704,"avatar_url":"https://avatars.githubusercontent.com/u/2834704?v=3","gravatar_id":"","url":"https://api.github.com/users/romgar","html_url":"https://github.com/romgar","followers_url":"https://api.github.com/users/romgar/followers","following_url":"https://api.github.com/users/romgar/following{/other_user}","gists_url":"https://api.github.com/users/romgar/gists{/gist_id}","starred_url":"https://api.github.com/users/romgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romgar/subscriptions","organizations_url":"https://api.github.com/users/romgar/orgs","repos_url":"https://api.github.com/users/romgar/repos","events_url":"https://api.github.com/users/romgar/events{/privacy}","received_events_url":"https://api.github.com/users/romgar/received_events","type":"User","site_admin":false},"repo":{"id":898046,"name":"django-dirtyfields","full_name":"romgar/django-dirtyfields","owner":{"login":"romgar","id":2834704,"avatar_url":"https://avatars.githubusercontent.com/u/2834704?v=3","gravatar_id":"","url":"https://api.github.com/users/romgar","html_url":"https://github.com/romgar","followers_url":"https://api.github.com/users/romgar/followers","following_url":"https://api.github.com/users/romgar/following{/other_user}","gists_url":"https://api.github.com/users/romgar/gists{/gist_id}","starred_url":"https://api.github.com/users/romgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romgar/subscriptions","organizations_url":"https://api.github.com/users/romgar/orgs","repos_url":"https://api.github.com/users/romgar/repos","events_url":"https://api.github.com/users/romgar/events{/privacy}","received_events_url":"https://api.github.com/users/romgar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/romgar/django-dirtyfields","description":"Tracking dirty fields on a Django model","fork":false,"url":"https://api.github.com/repos/romgar/django-dirtyfields","forks_url":"https://api.github.com/repos/romgar/django-dirtyfields/forks","keys_url":"https://api.github.com/repos/romgar/django-dirtyfields/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romgar/django-dirtyfields/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romgar/django-dirtyfields/teams","hooks_url":"https://api.github.com/repos/romgar/django-dirtyfields/hooks","issue_events_url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/events{/number}","events_url":"https://api.github.com/repos/romgar/django-dirtyfields/events","assignees_url":"https://api.github.com/repos/romgar/django-dirtyfields/assignees{/user}","branches_url":"https://api.github.com/repos/romgar/django-dirtyfields/branches{/branch}","tags_url":"https://api.github.com/repos/romgar/django-dirtyfields/tags","blobs_url":"https://api.github.com/repos/romgar/django-dirtyfields/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romgar/django-dirtyfields/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romgar/django-dirtyfields/git/refs{/sha}","trees_url":"https://api.github.com/repos/romgar/django-dirtyfields/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romgar/django-dirtyfields/statuses/{sha}","languages_url":"https://api.github.com/repos/romgar/django-dirtyfields/languages","stargazers_url":"https://api.github.com/repos/romgar/django-dirtyfields/stargazers","contributors_url":"https://api.github.com/repos/romgar/django-dirtyfields/contributors","subscribers_url":"https://api.github.com/repos/romgar/django-dirtyfields/subscribers","subscription_url":"https://api.github.com/repos/romgar/django-dirtyfields/subscription","commits_url":"https://api.github.com/repos/romgar/django-dirtyfields/commits{/sha}","git_commits_url":"https://api.github.com/repos/romgar/django-dirtyfields/git/commits{/sha}","comments_url":"https://api.github.com/repos/romgar/django-dirtyfields/comments{/number}","issue_comment_url":"https://api.github.com/repos/romgar/django-dirtyfields/issues/comments{/number}","contents_url":"https://api.github.com/repos/romgar/django-dirtyfields/contents/{+path}","compare_url":"https://api.github.com/repos/romgar/django-dirtyfields/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romgar/django-dirtyfields/merges","archive_url":"https://api.github.com/repos/romgar/django-dirtyfields/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romgar/django-dirtyfields/downloads","issues_url":"https://api.github.com/repos/romgar/django-dirtyfields/issues{/number}","pulls_url":"https://api.github.com/repos/romgar/django-dirtyfields/pulls{/number}","milestones_url":"https://api.github.com/repos/romgar/django-dirtyfields/milestones{/number}","notifications_url":"https://api.github.com/repos/romgar/django-dirtyfields/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romgar/django-dirtyfields/labels{/name}","releases_url":"https://api.github.com/repos/romgar/django-dirtyfields/releases{/id}","deployments_url":"https://api.github.com/repos/romgar/django-dirtyfields/deployments","created_at":"2010-09-09T06:54:09Z","updated_at":"2016-12-31T00:48:22Z","pushed_at":"2016-11-17T23:32:13Z","git_url":"git://github.com/romgar/django-dirtyfields.git","ssh_url":"git@github.com:romgar/django-dirtyfields.git","clone_url":"https://github.com/romgar/django-dirtyfields.git","svn_url":"https://github.com/romgar/django-dirtyfields","homepage":"","size":225,"stargazers_count":248,"watchers_count":248,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":73,"mirror_url":null,"open_issues_count":2,"forks":73,"open_issues":2,"watchers":248,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/romgar/django-dirtyfields/pulls/96"},"html":{"href":"https://github.com/romgar/django-dirtyfields/pull/96"},"issue":{"href":"https://api.github.com/repos/romgar/django-dirtyfields/issues/96"},"comments":{"href":"https://api.github.com/repos/romgar/django-dirtyfields/issues/96/comments"},"review_comments":{"href":"https://api.github.com/repos/romgar/django-dirtyfields/pulls/96/comments"},"review_comment":{"href":"https://api.github.com/repos/romgar/django-dirtyfields/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/romgar/django-dirtyfields/pulls/96/commits"},"statuses":{"href":"https://api.github.com/repos/romgar/django-dirtyfields/statuses/53c65fb170c38a111b26f42a8d588b1d50bfa8fd"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":4,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"zaius"}}