{"action":"closed","number":5076,"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/5076","id":41300433,"html_url":"https://github.com/django/django/pull/5076","diff_url":"https://github.com/django/django/pull/5076.diff","patch_url":"https://github.com/django/django/pull/5076.patch","issue_url":"https://api.github.com/repos/django/django/issues/5076","number":5076,"state":"closed","locked":false,"title":"Allow use_for_related_fields via as_manager()","user":{"login":"litchfield","id":130636,"avatar_url":"https://avatars.githubusercontent.com/u/130636?v=3","gravatar_id":"","url":"https://api.github.com/users/litchfield","html_url":"https://github.com/litchfield","followers_url":"https://api.github.com/users/litchfield/followers","following_url":"https://api.github.com/users/litchfield/following{/other_user}","gists_url":"https://api.github.com/users/litchfield/gists{/gist_id}","starred_url":"https://api.github.com/users/litchfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/litchfield/subscriptions","organizations_url":"https://api.github.com/users/litchfield/orgs","repos_url":"https://api.github.com/users/litchfield/repos","events_url":"https://api.github.com/users/litchfield/events{/privacy}","received_events_url":"https://api.github.com/users/litchfield/received_events","type":"User","site_admin":false},"body":"The as_manager() method allows easy creation of chain-able managers. One of the most common use cases for these is with related fields. However, as_manager() doesn't currently allow use_for_related_fields to be specified. This patch proposes it could be set simply by way of an attribute on the QuerySet class, in the same way it currently does for Manager classes.\r\n\r\nPatch is backwards compatible and includes docs (could be improved).\r\n\r\nTicket --\r\nhttps://code.djangoproject.com/ticket/25201#ticket\r\n\r\nDiscussion --\r\nhttps://groups.google.com/forum/#!topic/django-developers/hVbA6sWElPc","created_at":"2015-07-31T01:50:13Z","updated_at":"2015-07-31T02:10:42Z","closed_at":"2015-07-31T02:10:42Z","merged_at":null,"merge_commit_sha":"cfbda03c04d39d32e48bf9f7e60d413c0f40b00b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/5076/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/5076/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/5076/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/da4b62d0695a8591ac1c2d8e2d365cfd8e2ce220","head":{"label":"litchfield:master","ref":"master","sha":"da4b62d0695a8591ac1c2d8e2d365cfd8e2ce220","user":{"login":"litchfield","id":130636,"avatar_url":"https://avatars.githubusercontent.com/u/130636?v=3","gravatar_id":"","url":"https://api.github.com/users/litchfield","html_url":"https://github.com/litchfield","followers_url":"https://api.github.com/users/litchfield/followers","following_url":"https://api.github.com/users/litchfield/following{/other_user}","gists_url":"https://api.github.com/users/litchfield/gists{/gist_id}","starred_url":"https://api.github.com/users/litchfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/litchfield/subscriptions","organizations_url":"https://api.github.com/users/litchfield/orgs","repos_url":"https://api.github.com/users/litchfield/repos","events_url":"https://api.github.com/users/litchfield/events{/privacy}","received_events_url":"https://api.github.com/users/litchfield/received_events","type":"User","site_admin":false},"repo":{"id":38862811,"name":"django","full_name":"litchfield/django","owner":{"login":"litchfield","id":130636,"avatar_url":"https://avatars.githubusercontent.com/u/130636?v=3","gravatar_id":"","url":"https://api.github.com/users/litchfield","html_url":"https://github.com/litchfield","followers_url":"https://api.github.com/users/litchfield/followers","following_url":"https://api.github.com/users/litchfield/following{/other_user}","gists_url":"https://api.github.com/users/litchfield/gists{/gist_id}","starred_url":"https://api.github.com/users/litchfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/litchfield/subscriptions","organizations_url":"https://api.github.com/users/litchfield/orgs","repos_url":"https://api.github.com/users/litchfield/repos","events_url":"https://api.github.com/users/litchfield/events{/privacy}","received_events_url":"https://api.github.com/users/litchfield/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/litchfield/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/litchfield/django","forks_url":"https://api.github.com/repos/litchfield/django/forks","keys_url":"https://api.github.com/repos/litchfield/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/litchfield/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/litchfield/django/teams","hooks_url":"https://api.github.com/repos/litchfield/django/hooks","issue_events_url":"https://api.github.com/repos/litchfield/django/issues/events{/number}","events_url":"https://api.github.com/repos/litchfield/django/events","assignees_url":"https://api.github.com/repos/litchfield/django/assignees{/user}","branches_url":"https://api.github.com/repos/litchfield/django/branches{/branch}","tags_url":"https://api.github.com/repos/litchfield/django/tags","blobs_url":"https://api.github.com/repos/litchfield/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/litchfield/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/litchfield/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/litchfield/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/litchfield/django/statuses/{sha}","languages_url":"https://api.github.com/repos/litchfield/django/languages","stargazers_url":"https://api.github.com/repos/litchfield/django/stargazers","contributors_url":"https://api.github.com/repos/litchfield/django/contributors","subscribers_url":"https://api.github.com/repos/litchfield/django/subscribers","subscription_url":"https://api.github.com/repos/litchfield/django/subscription","commits_url":"https://api.github.com/repos/litchfield/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/litchfield/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/litchfield/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/litchfield/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/litchfield/django/contents/{+path}","compare_url":"https://api.github.com/repos/litchfield/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/litchfield/django/merges","archive_url":"https://api.github.com/repos/litchfield/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/litchfield/django/downloads","issues_url":"https://api.github.com/repos/litchfield/django/issues{/number}","pulls_url":"https://api.github.com/repos/litchfield/django/pulls{/number}","milestones_url":"https://api.github.com/repos/litchfield/django/milestones{/number}","notifications_url":"https://api.github.com/repos/litchfield/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/litchfield/django/labels{/name}","releases_url":"https://api.github.com/repos/litchfield/django/releases{/id}","created_at":"2015-07-10T05:31:29Z","updated_at":"2015-07-10T05:31:47Z","pushed_at":"2015-07-31T01:44:27Z","git_url":"git://github.com/litchfield/django.git","ssh_url":"git@github.com:litchfield/django.git","clone_url":"https://github.com/litchfield/django.git","svn_url":"https://github.com/litchfield/django","homepage":"https://www.djangoproject.com/","size":141472,"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":"b792c4804b611369c3e146f1fd967d9c5bdea17f","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}","created_at":"2012-04-28T02:47:18Z","updated_at":"2015-07-31T01:37:10Z","pushed_at":"2015-07-31T01:50:13Z","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":300853,"stargazers_count":15337,"watchers_count":15337,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6142,"mirror_url":null,"open_issues_count":80,"forks":6142,"open_issues":80,"watchers":15337,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/5076"},"html":{"href":"https://github.com/django/django/pull/5076"},"issue":{"href":"https://api.github.com/repos/django/django/issues/5076"},"comments":{"href":"https://api.github.com/repos/django/django/issues/5076/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/5076/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/5076/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/da4b62d0695a8591ac1c2d8e2d365cfd8e2ce220"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":1,"review_comments":0,"commits":5,"additions":18,"deletions":4,"changed_files":2}}