{"action":"created","comment":{"url":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/comments/52102337","id":52102337,"diff_hunk":"@@ -270,6 +272,18 @@ def wrapper(request, *args, **kwargs):\n \n         return wrapper\n \n+    def handle_patch_for_filefields(self, bundle, data_to_patch):\n+        obj = bundle.obj\n+        data_to_patch_copy = data_to_patch.copy()\n+        fixed_data = {}\n+\n+        for field in obj._meta.local_fields:\n+            if type(field) in [ImageField, FileField]:\n+                fixed_data[field.name] = field._get_val_from_obj(obj).name","path":"tastypie/resources.py","position":20,"original_position":20,"commit_id":"e411988380d4fd86d639f90d397b08a856bda0c2","original_commit_id":"e411988380d4fd86d639f90d397b08a856bda0c2","user":{"login":"SeanHayes","id":134373,"avatar_url":"https://avatars.githubusercontent.com/u/134373?v=3","gravatar_id":"","url":"https://api.github.com/users/SeanHayes","html_url":"https://github.com/SeanHayes","followers_url":"https://api.github.com/users/SeanHayes/followers","following_url":"https://api.github.com/users/SeanHayes/following{/other_user}","gists_url":"https://api.github.com/users/SeanHayes/gists{/gist_id}","starred_url":"https://api.github.com/users/SeanHayes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeanHayes/subscriptions","organizations_url":"https://api.github.com/users/SeanHayes/orgs","repos_url":"https://api.github.com/users/SeanHayes/repos","events_url":"https://api.github.com/users/SeanHayes/events{/privacy}","received_events_url":"https://api.github.com/users/SeanHayes/received_events","type":"User","site_admin":false},"body":"Any excluded FileFields on a model will get leaked into fixed_data.","created_at":"2016-02-06T14:00:43Z","updated_at":"2016-02-06T14:00:43Z","html_url":"https://github.com/django-tastypie/django-tastypie/pull/1428#discussion_r52102337","pull_request_url":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/1428","_links":{"self":{"href":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/comments/52102337"},"html":{"href":"https://github.com/django-tastypie/django-tastypie/pull/1428#discussion_r52102337"},"pull_request":{"href":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/1428"}}},"pull_request":{"url":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/1428","id":57777180,"html_url":"https://github.com/django-tastypie/django-tastypie/pull/1428","diff_url":"https://github.com/django-tastypie/django-tastypie/pull/1428.diff","patch_url":"https://github.com/django-tastypie/django-tastypie/pull/1428.patch","issue_url":"https://api.github.com/repos/django-tastypie/django-tastypie/issues/1428","number":1428,"state":"open","locked":false,"title":"Fix for \"PATCH on ModelResource clears Resource's ImageField data\"","user":{"login":"ketanbhatt","id":9729957,"avatar_url":"https://avatars.githubusercontent.com/u/9729957?v=3","gravatar_id":"","url":"https://api.github.com/users/ketanbhatt","html_url":"https://github.com/ketanbhatt","followers_url":"https://api.github.com/users/ketanbhatt/followers","following_url":"https://api.github.com/users/ketanbhatt/following{/other_user}","gists_url":"https://api.github.com/users/ketanbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/ketanbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketanbhatt/subscriptions","organizations_url":"https://api.github.com/users/ketanbhatt/orgs","repos_url":"https://api.github.com/users/ketanbhatt/repos","events_url":"https://api.github.com/users/ketanbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/ketanbhatt/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-31T19:15:44Z","updated_at":"2016-02-06T14:00:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a5c7638014d643b039e89fc2f5ad402cbc6e78c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/1428/commits","review_comments_url":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/1428/comments","review_comment_url":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django-tastypie/django-tastypie/issues/1428/comments","statuses_url":"https://api.github.com/repos/django-tastypie/django-tastypie/statuses/e411988380d4fd86d639f90d397b08a856bda0c2","head":{"label":"ketanbhatt:kb_1018_fix_change_in_filefield_on_patch","ref":"kb_1018_fix_change_in_filefield_on_patch","sha":"e411988380d4fd86d639f90d397b08a856bda0c2","user":{"login":"ketanbhatt","id":9729957,"avatar_url":"https://avatars.githubusercontent.com/u/9729957?v=3","gravatar_id":"","url":"https://api.github.com/users/ketanbhatt","html_url":"https://github.com/ketanbhatt","followers_url":"https://api.github.com/users/ketanbhatt/followers","following_url":"https://api.github.com/users/ketanbhatt/following{/other_user}","gists_url":"https://api.github.com/users/ketanbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/ketanbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketanbhatt/subscriptions","organizations_url":"https://api.github.com/users/ketanbhatt/orgs","repos_url":"https://api.github.com/users/ketanbhatt/repos","events_url":"https://api.github.com/users/ketanbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/ketanbhatt/received_events","type":"User","site_admin":false},"repo":{"id":50775911,"name":"django-tastypie","full_name":"ketanbhatt/django-tastypie","owner":{"login":"ketanbhatt","id":9729957,"avatar_url":"https://avatars.githubusercontent.com/u/9729957?v=3","gravatar_id":"","url":"https://api.github.com/users/ketanbhatt","html_url":"https://github.com/ketanbhatt","followers_url":"https://api.github.com/users/ketanbhatt/followers","following_url":"https://api.github.com/users/ketanbhatt/following{/other_user}","gists_url":"https://api.github.com/users/ketanbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/ketanbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketanbhatt/subscriptions","organizations_url":"https://api.github.com/users/ketanbhatt/orgs","repos_url":"https://api.github.com/users/ketanbhatt/repos","events_url":"https://api.github.com/users/ketanbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/ketanbhatt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ketanbhatt/django-tastypie","description":"Creating delicious APIs for Django apps since 2010. v0.12.0","fork":true,"url":"https://api.github.com/repos/ketanbhatt/django-tastypie","forks_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/forks","keys_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/teams","hooks_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/hooks","issue_events_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/issues/events{/number}","events_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/events","assignees_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/assignees{/user}","branches_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/branches{/branch}","tags_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/tags","blobs_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/git/refs{/sha}","trees_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/statuses/{sha}","languages_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/languages","stargazers_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/stargazers","contributors_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/contributors","subscribers_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/subscribers","subscription_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/subscription","commits_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/commits{/sha}","git_commits_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/git/commits{/sha}","comments_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/comments{/number}","issue_comment_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/issues/comments{/number}","contents_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/contents/{+path}","compare_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/merges","archive_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/downloads","issues_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/issues{/number}","pulls_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/pulls{/number}","milestones_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/milestones{/number}","notifications_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/labels{/name}","releases_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/releases{/id}","deployments_url":"https://api.github.com/repos/ketanbhatt/django-tastypie/deployments","created_at":"2016-01-31T13:33:00Z","updated_at":"2016-01-31T13:33:02Z","pushed_at":"2016-02-01T06:36:06Z","git_url":"git://github.com/ketanbhatt/django-tastypie.git","ssh_url":"git@github.com:ketanbhatt/django-tastypie.git","clone_url":"https://github.com/ketanbhatt/django-tastypie.git","svn_url":"https://github.com/ketanbhatt/django-tastypie","homepage":"http://tastypieapi.org/","size":3140,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"django-tastypie:master","ref":"master","sha":"f6ed7d531bb34457ba96d9a66892a9544e86fe4b","user":{"login":"django-tastypie","id":10821692,"avatar_url":"https://avatars.githubusercontent.com/u/10821692?v=3","gravatar_id":"","url":"https://api.github.com/users/django-tastypie","html_url":"https://github.com/django-tastypie","followers_url":"https://api.github.com/users/django-tastypie/followers","following_url":"https://api.github.com/users/django-tastypie/following{/other_user}","gists_url":"https://api.github.com/users/django-tastypie/gists{/gist_id}","starred_url":"https://api.github.com/users/django-tastypie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django-tastypie/subscriptions","organizations_url":"https://api.github.com/users/django-tastypie/orgs","repos_url":"https://api.github.com/users/django-tastypie/repos","events_url":"https://api.github.com/users/django-tastypie/events{/privacy}","received_events_url":"https://api.github.com/users/django-tastypie/received_events","type":"Organization","site_admin":false},"repo":{"id":584410,"name":"django-tastypie","full_name":"django-tastypie/django-tastypie","owner":{"login":"django-tastypie","id":10821692,"avatar_url":"https://avatars.githubusercontent.com/u/10821692?v=3","gravatar_id":"","url":"https://api.github.com/users/django-tastypie","html_url":"https://github.com/django-tastypie","followers_url":"https://api.github.com/users/django-tastypie/followers","following_url":"https://api.github.com/users/django-tastypie/following{/other_user}","gists_url":"https://api.github.com/users/django-tastypie/gists{/gist_id}","starred_url":"https://api.github.com/users/django-tastypie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django-tastypie/subscriptions","organizations_url":"https://api.github.com/users/django-tastypie/orgs","repos_url":"https://api.github.com/users/django-tastypie/repos","events_url":"https://api.github.com/users/django-tastypie/events{/privacy}","received_events_url":"https://api.github.com/users/django-tastypie/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django-tastypie/django-tastypie","description":"Creating delicious APIs for Django apps since 2010. v0.12.0","fork":false,"url":"https://api.github.com/repos/django-tastypie/django-tastypie","forks_url":"https://api.github.com/repos/django-tastypie/django-tastypie/forks","keys_url":"https://api.github.com/repos/django-tastypie/django-tastypie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django-tastypie/django-tastypie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django-tastypie/django-tastypie/teams","hooks_url":"https://api.github.com/repos/django-tastypie/django-tastypie/hooks","issue_events_url":"https://api.github.com/repos/django-tastypie/django-tastypie/issues/events{/number}","events_url":"https://api.github.com/repos/django-tastypie/django-tastypie/events","assignees_url":"https://api.github.com/repos/django-tastypie/django-tastypie/assignees{/user}","branches_url":"https://api.github.com/repos/django-tastypie/django-tastypie/branches{/branch}","tags_url":"https://api.github.com/repos/django-tastypie/django-tastypie/tags","blobs_url":"https://api.github.com/repos/django-tastypie/django-tastypie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django-tastypie/django-tastypie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django-tastypie/django-tastypie/git/refs{/sha}","trees_url":"https://api.github.com/repos/django-tastypie/django-tastypie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django-tastypie/django-tastypie/statuses/{sha}","languages_url":"https://api.github.com/repos/django-tastypie/django-tastypie/languages","stargazers_url":"https://api.github.com/repos/django-tastypie/django-tastypie/stargazers","contributors_url":"https://api.github.com/repos/django-tastypie/django-tastypie/contributors","subscribers_url":"https://api.github.com/repos/django-tastypie/django-tastypie/subscribers","subscription_url":"https://api.github.com/repos/django-tastypie/django-tastypie/subscription","commits_url":"https://api.github.com/repos/django-tastypie/django-tastypie/commits{/sha}","git_commits_url":"https://api.github.com/repos/django-tastypie/django-tastypie/git/commits{/sha}","comments_url":"https://api.github.com/repos/django-tastypie/django-tastypie/comments{/number}","issue_comment_url":"https://api.github.com/repos/django-tastypie/django-tastypie/issues/comments{/number}","contents_url":"https://api.github.com/repos/django-tastypie/django-tastypie/contents/{+path}","compare_url":"https://api.github.com/repos/django-tastypie/django-tastypie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django-tastypie/django-tastypie/merges","archive_url":"https://api.github.com/repos/django-tastypie/django-tastypie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django-tastypie/django-tastypie/downloads","issues_url":"https://api.github.com/repos/django-tastypie/django-tastypie/issues{/number}","pulls_url":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls{/number}","milestones_url":"https://api.github.com/repos/django-tastypie/django-tastypie/milestones{/number}","notifications_url":"https://api.github.com/repos/django-tastypie/django-tastypie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django-tastypie/django-tastypie/labels{/name}","releases_url":"https://api.github.com/repos/django-tastypie/django-tastypie/releases{/id}","deployments_url":"https://api.github.com/repos/django-tastypie/django-tastypie/deployments","created_at":"2010-03-29T06:01:45Z","updated_at":"2016-02-05T05:24:45Z","pushed_at":"2016-02-06T13:30:19Z","git_url":"git://github.com/django-tastypie/django-tastypie.git","ssh_url":"git@github.com:django-tastypie/django-tastypie.git","clone_url":"https://github.com/django-tastypie/django-tastypie.git","svn_url":"https://github.com/django-tastypie/django-tastypie","homepage":"http://tastypieapi.org/","size":6602,"stargazers_count":2883,"watchers_count":2883,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1015,"mirror_url":null,"open_issues_count":482,"forks":1015,"open_issues":482,"watchers":2883,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/1428"},"html":{"href":"https://github.com/django-tastypie/django-tastypie/pull/1428"},"issue":{"href":"https://api.github.com/repos/django-tastypie/django-tastypie/issues/1428"},"comments":{"href":"https://api.github.com/repos/django-tastypie/django-tastypie/issues/1428/comments"},"review_comments":{"href":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/1428/comments"},"review_comment":{"href":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django-tastypie/django-tastypie/pulls/1428/commits"},"statuses":{"href":"https://api.github.com/repos/django-tastypie/django-tastypie/statuses/e411988380d4fd86d639f90d397b08a856bda0c2"}}}}