{"action":"created","comment":{"url":"https://api.github.com/repos/google/oauth2client/pulls/comments/40961244","id":40961244,"diff_hunk":"@@ -46,12 +46,16 @@ def to_python(self, value):\n             return None\n         if isinstance(value, oauth2client.client.Credentials):\n             return value\n-        return pickle.loads(base64.b64decode(value))\n+        return pickle.loads(base64.b64decode(smart_bytes(value)))\n \n-    def get_db_prep_value(self, value, connection, prepared=False):","path":"oauth2client/django_orm.py","position":28,"original_position":28,"commit_id":"640070fcf3a65a18f8154e523340f17fa8998a70","original_commit_id":"640070fcf3a65a18f8154e523340f17fa8998a70","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"body":"@szopu I'm not a Django user, can you explain why you got rid of ` get_db_prep_value` and swapped out for `get_prep_value` and `value_to_string`?","created_at":"2015-10-01T20:20:09Z","updated_at":"2015-10-01T20:20:09Z","html_url":"https://github.com/google/oauth2client/pull/316#discussion_r40961244","pull_request_url":"https://api.github.com/repos/google/oauth2client/pulls/316","_links":{"self":{"href":"https://api.github.com/repos/google/oauth2client/pulls/comments/40961244"},"html":{"href":"https://github.com/google/oauth2client/pull/316#discussion_r40961244"},"pull_request":{"href":"https://api.github.com/repos/google/oauth2client/pulls/316"}}},"pull_request":{"url":"https://api.github.com/repos/google/oauth2client/pulls/316","id":46569604,"html_url":"https://github.com/google/oauth2client/pull/316","diff_url":"https://github.com/google/oauth2client/pull/316.diff","patch_url":"https://github.com/google/oauth2client/pull/316.patch","issue_url":"https://api.github.com/repos/google/oauth2client/issues/316","number":316,"state":"open","locked":false,"title":"Issue #142: CredentialField Python 3 fix","user":{"login":"szopu","id":168152,"avatar_url":"https://avatars.githubusercontent.com/u/168152?v=3","gravatar_id":"","url":"https://api.github.com/users/szopu","html_url":"https://github.com/szopu","followers_url":"https://api.github.com/users/szopu/followers","following_url":"https://api.github.com/users/szopu/following{/other_user}","gists_url":"https://api.github.com/users/szopu/gists{/gist_id}","starred_url":"https://api.github.com/users/szopu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szopu/subscriptions","organizations_url":"https://api.github.com/users/szopu/orgs","repos_url":"https://api.github.com/users/szopu/repos","events_url":"https://api.github.com/users/szopu/events{/privacy}","received_events_url":"https://api.github.com/users/szopu/received_events","type":"User","site_admin":false},"body":"This PR should fix issue #142.\r\n\r\nChanges\r\n* in `oauth2client.django_orm.CredentialsField`:\r\n  * Python 2/3 metaclass support \r\n  * using `get_prep_value` instead of `get_db_prep_value`\r\n  * added `value_to_string` method \r\n  * explicit conversions to text/bytes types in `get_prep_value`, `to_python` (required by Python 3)\r\n* in `test_django_orm` tests:\r\n  * added explicit conversion to bytes so the tests can work on Python 3","created_at":"2015-10-01T20:01:48Z","updated_at":"2015-10-01T20:20:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff233e4b74a6426e0ff8635378d369b1fc7983d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/oauth2client/pulls/316/commits","review_comments_url":"https://api.github.com/repos/google/oauth2client/pulls/316/comments","review_comment_url":"https://api.github.com/repos/google/oauth2client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/oauth2client/issues/316/comments","statuses_url":"https://api.github.com/repos/google/oauth2client/statuses/640070fcf3a65a18f8154e523340f17fa8998a70","head":{"label":"szopu:django-credentials-field-py3-fix","ref":"django-credentials-field-py3-fix","sha":"640070fcf3a65a18f8154e523340f17fa8998a70","user":{"login":"szopu","id":168152,"avatar_url":"https://avatars.githubusercontent.com/u/168152?v=3","gravatar_id":"","url":"https://api.github.com/users/szopu","html_url":"https://github.com/szopu","followers_url":"https://api.github.com/users/szopu/followers","following_url":"https://api.github.com/users/szopu/following{/other_user}","gists_url":"https://api.github.com/users/szopu/gists{/gist_id}","starred_url":"https://api.github.com/users/szopu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szopu/subscriptions","organizations_url":"https://api.github.com/users/szopu/orgs","repos_url":"https://api.github.com/users/szopu/repos","events_url":"https://api.github.com/users/szopu/events{/privacy}","received_events_url":"https://api.github.com/users/szopu/received_events","type":"User","site_admin":false},"repo":{"id":43364004,"name":"oauth2client","full_name":"szopu/oauth2client","owner":{"login":"szopu","id":168152,"avatar_url":"https://avatars.githubusercontent.com/u/168152?v=3","gravatar_id":"","url":"https://api.github.com/users/szopu","html_url":"https://github.com/szopu","followers_url":"https://api.github.com/users/szopu/followers","following_url":"https://api.github.com/users/szopu/following{/other_user}","gists_url":"https://api.github.com/users/szopu/gists{/gist_id}","starred_url":"https://api.github.com/users/szopu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szopu/subscriptions","organizations_url":"https://api.github.com/users/szopu/orgs","repos_url":"https://api.github.com/users/szopu/repos","events_url":"https://api.github.com/users/szopu/events{/privacy}","received_events_url":"https://api.github.com/users/szopu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/szopu/oauth2client","description":"This is a Python library for accessing resources protected by OAuth 2.0.","fork":true,"url":"https://api.github.com/repos/szopu/oauth2client","forks_url":"https://api.github.com/repos/szopu/oauth2client/forks","keys_url":"https://api.github.com/repos/szopu/oauth2client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/szopu/oauth2client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/szopu/oauth2client/teams","hooks_url":"https://api.github.com/repos/szopu/oauth2client/hooks","issue_events_url":"https://api.github.com/repos/szopu/oauth2client/issues/events{/number}","events_url":"https://api.github.com/repos/szopu/oauth2client/events","assignees_url":"https://api.github.com/repos/szopu/oauth2client/assignees{/user}","branches_url":"https://api.github.com/repos/szopu/oauth2client/branches{/branch}","tags_url":"https://api.github.com/repos/szopu/oauth2client/tags","blobs_url":"https://api.github.com/repos/szopu/oauth2client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/szopu/oauth2client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/szopu/oauth2client/git/refs{/sha}","trees_url":"https://api.github.com/repos/szopu/oauth2client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/szopu/oauth2client/statuses/{sha}","languages_url":"https://api.github.com/repos/szopu/oauth2client/languages","stargazers_url":"https://api.github.com/repos/szopu/oauth2client/stargazers","contributors_url":"https://api.github.com/repos/szopu/oauth2client/contributors","subscribers_url":"https://api.github.com/repos/szopu/oauth2client/subscribers","subscription_url":"https://api.github.com/repos/szopu/oauth2client/subscription","commits_url":"https://api.github.com/repos/szopu/oauth2client/commits{/sha}","git_commits_url":"https://api.github.com/repos/szopu/oauth2client/git/commits{/sha}","comments_url":"https://api.github.com/repos/szopu/oauth2client/comments{/number}","issue_comment_url":"https://api.github.com/repos/szopu/oauth2client/issues/comments{/number}","contents_url":"https://api.github.com/repos/szopu/oauth2client/contents/{+path}","compare_url":"https://api.github.com/repos/szopu/oauth2client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/szopu/oauth2client/merges","archive_url":"https://api.github.com/repos/szopu/oauth2client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/szopu/oauth2client/downloads","issues_url":"https://api.github.com/repos/szopu/oauth2client/issues{/number}","pulls_url":"https://api.github.com/repos/szopu/oauth2client/pulls{/number}","milestones_url":"https://api.github.com/repos/szopu/oauth2client/milestones{/number}","notifications_url":"https://api.github.com/repos/szopu/oauth2client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/szopu/oauth2client/labels{/name}","releases_url":"https://api.github.com/repos/szopu/oauth2client/releases{/id}","created_at":"2015-09-29T11:43:00Z","updated_at":"2015-09-29T11:43:03Z","pushed_at":"2015-10-01T19:45:13Z","git_url":"git://github.com/szopu/oauth2client.git","ssh_url":"git@github.com:szopu/oauth2client.git","clone_url":"https://github.com/szopu/oauth2client.git","svn_url":"https://github.com/szopu/oauth2client","homepage":"","size":23156,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"af6d3eb8067d5c95fb59af6fb62a192e6c7fa16b","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":14211461,"name":"oauth2client","full_name":"google/oauth2client","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/oauth2client","description":"This is a Python library for accessing resources protected by OAuth 2.0.","fork":false,"url":"https://api.github.com/repos/google/oauth2client","forks_url":"https://api.github.com/repos/google/oauth2client/forks","keys_url":"https://api.github.com/repos/google/oauth2client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/oauth2client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/oauth2client/teams","hooks_url":"https://api.github.com/repos/google/oauth2client/hooks","issue_events_url":"https://api.github.com/repos/google/oauth2client/issues/events{/number}","events_url":"https://api.github.com/repos/google/oauth2client/events","assignees_url":"https://api.github.com/repos/google/oauth2client/assignees{/user}","branches_url":"https://api.github.com/repos/google/oauth2client/branches{/branch}","tags_url":"https://api.github.com/repos/google/oauth2client/tags","blobs_url":"https://api.github.com/repos/google/oauth2client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/oauth2client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/oauth2client/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/oauth2client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/oauth2client/statuses/{sha}","languages_url":"https://api.github.com/repos/google/oauth2client/languages","stargazers_url":"https://api.github.com/repos/google/oauth2client/stargazers","contributors_url":"https://api.github.com/repos/google/oauth2client/contributors","subscribers_url":"https://api.github.com/repos/google/oauth2client/subscribers","subscription_url":"https://api.github.com/repos/google/oauth2client/subscription","commits_url":"https://api.github.com/repos/google/oauth2client/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/oauth2client/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/oauth2client/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/oauth2client/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/oauth2client/contents/{+path}","compare_url":"https://api.github.com/repos/google/oauth2client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/oauth2client/merges","archive_url":"https://api.github.com/repos/google/oauth2client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/oauth2client/downloads","issues_url":"https://api.github.com/repos/google/oauth2client/issues{/number}","pulls_url":"https://api.github.com/repos/google/oauth2client/pulls{/number}","milestones_url":"https://api.github.com/repos/google/oauth2client/milestones{/number}","notifications_url":"https://api.github.com/repos/google/oauth2client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/oauth2client/labels{/name}","releases_url":"https://api.github.com/repos/google/oauth2client/releases{/id}","created_at":"2013-11-07T18:03:04Z","updated_at":"2015-10-01T14:47:42Z","pushed_at":"2015-10-01T20:01:48Z","git_url":"git://github.com/google/oauth2client.git","ssh_url":"git@github.com:google/oauth2client.git","clone_url":"https://github.com/google/oauth2client.git","svn_url":"https://github.com/google/oauth2client","homepage":"","size":25272,"stargazers_count":245,"watchers_count":245,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":125,"mirror_url":null,"open_issues_count":50,"forks":125,"open_issues":50,"watchers":245,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/oauth2client/pulls/316"},"html":{"href":"https://github.com/google/oauth2client/pull/316"},"issue":{"href":"https://api.github.com/repos/google/oauth2client/issues/316"},"comments":{"href":"https://api.github.com/repos/google/oauth2client/issues/316/comments"},"review_comments":{"href":"https://api.github.com/repos/google/oauth2client/pulls/316/comments"},"review_comment":{"href":"https://api.github.com/repos/google/oauth2client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/oauth2client/pulls/316/commits"},"statuses":{"href":"https://api.github.com/repos/google/oauth2client/statuses/640070fcf3a65a18f8154e523340f17fa8998a70"}}}}