{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/92898623","pull_request_review_id":13424334,"id":92898623,"diff_hunk":"@@ -974,15 +974,35 @@ Due to how inheritance works, you have to set both ``pk`` and ``id`` to None::\n     django_blog.id = None\n     django_blog.save() # django_blog.pk == 4\n \n-This process does not copy related objects. If you want to copy relations,\n-you have to write a little bit more code. In our example, ``Entry`` has a many to many\n-field to ``Author``::\n+This process does not copy :class:`~django.db.models.ManyToManyField`,\n+:class:`~django.db.models.OneToOneField`, or\n+:class:`~django.db.models.ForeignKey` _reverse_ relations. If you want to copy\n+these relations, you have to write a little bit more code. In our example,\n+``Entry`` has a ManyToMany field to ``Author``::\n \n     entry = Entry.objects.all()[0] # some previous entry\n     old_authors = entry.authors.all()\n     entry.pk = None\n     entry.save()\n-    entry.authors = old_authors # saves new many2many relations\n+    entry.authors = old_authors \n+    entry.save() # saves new many2many relations against new pk\n+\n+For the forward relation of a ForeignKey, as the foreign key itself is stored","path":"docs/topics/db/queries.txt","position":21,"original_position":21,"commit_id":"0231334665439aa8ca87588b4b797bd680dd2f4f","original_commit_id":"0231334665439aa8ca87588b4b797bd680dd2f4f","user":{"login":"timgraham","id":411869,"avatar_url":"https://avatars.githubusercontent.com/u/411869?v=3","gravatar_id":"","url":"https://api.github.com/users/timgraham","html_url":"https://github.com/timgraham","followers_url":"https://api.github.com/users/timgraham/followers","following_url":"https://api.github.com/users/timgraham/following{/other_user}","gists_url":"https://api.github.com/users/timgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/timgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgraham/subscriptions","organizations_url":"https://api.github.com/users/timgraham/orgs","repos_url":"https://api.github.com/users/timgraham/repos","events_url":"https://api.github.com/users/timgraham/events{/privacy}","received_events_url":"https://api.github.com/users/timgraham/received_events","type":"User","site_admin":false},"body":"I'm not sure this is valuable since this section is about describing what extra work needs to be done. Here you've only shown something that does work, which seems unnecessary to me.","created_at":"2016-12-16T22:41:56Z","updated_at":"2016-12-16T22:41:56Z","html_url":"https://github.com/django/django/pull/6958#discussion_r92898623","pull_request_url":"https://api.github.com/repos/django/django/pulls/6958","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/92898623"},"html":{"href":"https://github.com/django/django/pull/6958#discussion_r92898623"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/6958"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/6958","id":78392300,"html_url":"https://github.com/django/django/pull/6958","diff_url":"https://github.com/django/django/pull/6958.diff","patch_url":"https://github.com/django/django/pull/6958.patch","issue_url":"https://api.github.com/repos/django/django/issues/6958","number":6958,"state":"open","locked":false,"title":"Improved documentation for Copying Model Instances","user":{"login":"agilgur5","id":4970083,"avatar_url":"https://avatars.githubusercontent.com/u/4970083?v=3","gravatar_id":"","url":"https://api.github.com/users/agilgur5","html_url":"https://github.com/agilgur5","followers_url":"https://api.github.com/users/agilgur5/followers","following_url":"https://api.github.com/users/agilgur5/following{/other_user}","gists_url":"https://api.github.com/users/agilgur5/gists{/gist_id}","starred_url":"https://api.github.com/users/agilgur5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agilgur5/subscriptions","organizations_url":"https://api.github.com/users/agilgur5/orgs","repos_url":"https://api.github.com/users/agilgur5/repos","events_url":"https://api.github.com/users/agilgur5/events{/privacy}","received_events_url":"https://api.github.com/users/agilgur5/received_events","type":"User","site_admin":false},"body":"Clarified documentation to be more specific about how copying works with\nvarious relations. Previous documentation stated that all relations require\nextra code to copy over, but this is only the case for certain relations.\n","created_at":"2016-07-21T21:39:58Z","updated_at":"2016-12-16T22:57:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2310229bf785b84c03e6328d43425a626932e3a5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/6958/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/6958/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/6958/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/0231334665439aa8ca87588b4b797bd680dd2f4f","head":{"label":"agilgur5:patch-1","ref":"patch-1","sha":"0231334665439aa8ca87588b4b797bd680dd2f4f","user":{"login":"agilgur5","id":4970083,"avatar_url":"https://avatars.githubusercontent.com/u/4970083?v=3","gravatar_id":"","url":"https://api.github.com/users/agilgur5","html_url":"https://github.com/agilgur5","followers_url":"https://api.github.com/users/agilgur5/followers","following_url":"https://api.github.com/users/agilgur5/following{/other_user}","gists_url":"https://api.github.com/users/agilgur5/gists{/gist_id}","starred_url":"https://api.github.com/users/agilgur5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agilgur5/subscriptions","organizations_url":"https://api.github.com/users/agilgur5/orgs","repos_url":"https://api.github.com/users/agilgur5/repos","events_url":"https://api.github.com/users/agilgur5/events{/privacy}","received_events_url":"https://api.github.com/users/agilgur5/received_events","type":"User","site_admin":false},"repo":{"id":63902147,"name":"django","full_name":"agilgur5/django","owner":{"login":"agilgur5","id":4970083,"avatar_url":"https://avatars.githubusercontent.com/u/4970083?v=3","gravatar_id":"","url":"https://api.github.com/users/agilgur5","html_url":"https://github.com/agilgur5","followers_url":"https://api.github.com/users/agilgur5/followers","following_url":"https://api.github.com/users/agilgur5/following{/other_user}","gists_url":"https://api.github.com/users/agilgur5/gists{/gist_id}","starred_url":"https://api.github.com/users/agilgur5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agilgur5/subscriptions","organizations_url":"https://api.github.com/users/agilgur5/orgs","repos_url":"https://api.github.com/users/agilgur5/repos","events_url":"https://api.github.com/users/agilgur5/events{/privacy}","received_events_url":"https://api.github.com/users/agilgur5/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/agilgur5/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/agilgur5/django","forks_url":"https://api.github.com/repos/agilgur5/django/forks","keys_url":"https://api.github.com/repos/agilgur5/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agilgur5/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agilgur5/django/teams","hooks_url":"https://api.github.com/repos/agilgur5/django/hooks","issue_events_url":"https://api.github.com/repos/agilgur5/django/issues/events{/number}","events_url":"https://api.github.com/repos/agilgur5/django/events","assignees_url":"https://api.github.com/repos/agilgur5/django/assignees{/user}","branches_url":"https://api.github.com/repos/agilgur5/django/branches{/branch}","tags_url":"https://api.github.com/repos/agilgur5/django/tags","blobs_url":"https://api.github.com/repos/agilgur5/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agilgur5/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agilgur5/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/agilgur5/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agilgur5/django/statuses/{sha}","languages_url":"https://api.github.com/repos/agilgur5/django/languages","stargazers_url":"https://api.github.com/repos/agilgur5/django/stargazers","contributors_url":"https://api.github.com/repos/agilgur5/django/contributors","subscribers_url":"https://api.github.com/repos/agilgur5/django/subscribers","subscription_url":"https://api.github.com/repos/agilgur5/django/subscription","commits_url":"https://api.github.com/repos/agilgur5/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/agilgur5/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/agilgur5/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/agilgur5/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/agilgur5/django/contents/{+path}","compare_url":"https://api.github.com/repos/agilgur5/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agilgur5/django/merges","archive_url":"https://api.github.com/repos/agilgur5/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agilgur5/django/downloads","issues_url":"https://api.github.com/repos/agilgur5/django/issues{/number}","pulls_url":"https://api.github.com/repos/agilgur5/django/pulls{/number}","milestones_url":"https://api.github.com/repos/agilgur5/django/milestones{/number}","notifications_url":"https://api.github.com/repos/agilgur5/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agilgur5/django/labels{/name}","releases_url":"https://api.github.com/repos/agilgur5/django/releases{/id}","deployments_url":"https://api.github.com/repos/agilgur5/django/deployments","created_at":"2016-07-21T21:01:27Z","updated_at":"2016-07-21T21:01:46Z","pushed_at":"2016-07-21T21:36:52Z","git_url":"git://github.com/agilgur5/django.git","ssh_url":"git@github.com:agilgur5/django.git","clone_url":"https://github.com/agilgur5/django.git","svn_url":"https://github.com/agilgur5/django","homepage":"https://www.djangoproject.com/","size":142548,"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:master","ref":"master","sha":"bc1e9e823b7dd3fa68dc1678edeb09e2ae1a990c","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","deployments_url":"https://api.github.com/repos/django/django/deployments","created_at":"2012-04-28T02:47:18Z","updated_at":"2016-12-16T20:52:37Z","pushed_at":"2016-12-16T22:55:57Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":155322,"stargazers_count":22639,"watchers_count":22639,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9160,"mirror_url":null,"open_issues_count":111,"forks":9160,"open_issues":111,"watchers":22639,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/6958"},"html":{"href":"https://github.com/django/django/pull/6958"},"issue":{"href":"https://api.github.com/repos/django/django/issues/6958"},"comments":{"href":"https://api.github.com/repos/django/django/issues/6958/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/6958/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/6958/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/0231334665439aa8ca87588b4b797bd680dd2f4f"}}}}
{"actor":{"display_login":"timgraham"}}