{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/50588970","id":50588970,"diff_hunk":"@@ -985,14 +988,14 @@ abstract base class (only), part of the name should contain\n - ``'%(app_label)s'`` is replaced by the lower-cased name of the app the child\n   class is contained within. Each installed application name must be unique\n   and the model class names within each app must also be unique, therefore the\n-  resulting name will end up being different.\n+  resulting name or query name will end up being different.\n \n For example, given an app ``common/models.py``::\n \n     from django.db import models\n \n     class Base(models.Model):\n-        m2m = models.ManyToManyField(OtherModel, related_name=\"%(app_label)s_%(class)s_related\")\n+        m2m = models.ManyToManyField(OtherModel, related_name=\"%(app_label)s_%(class)s_related\", related_query_name=\"%(app_label)s_%(class)ss\")","path":"docs/topics/db/models.txt","position":41,"original_position":41,"commit_id":"29dcfb0754cbd9112d485346fa9e648b105c119f","original_commit_id":"29dcfb0754cbd9112d485346fa9e648b105c119f","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":"This is a bit long so please use:\r\n```\r\nm2m = models.ManyToManyField(\r\n    OtherModel,\r\n    related_name=\"%(app_label)s_%(class)s_related\",\r\n    related_query_name=\"%(app_label)s_%(class)s\",\r\n)\r\n```","created_at":"2016-01-22T20:50:01Z","updated_at":"2016-01-22T20:50:01Z","html_url":"https://github.com/django/django/pull/5886#discussion_r50588970","pull_request_url":"https://api.github.com/repos/django/django/pulls/5886","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/50588970"},"html":{"href":"https://github.com/django/django/pull/5886#discussion_r50588970"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/5886"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/5886","id":54688641,"html_url":"https://github.com/django/django/pull/5886","diff_url":"https://github.com/django/django/pull/5886.diff","patch_url":"https://github.com/django/django/pull/5886.patch","issue_url":"https://api.github.com/repos/django/django/issues/5886","number":5886,"state":"open","locked":false,"title":"Fixed #25354 -- Added class/app_label interpolation","user":{"login":"jpulec","id":407780,"avatar_url":"https://avatars.githubusercontent.com/u/407780?v=3","gravatar_id":"","url":"https://api.github.com/users/jpulec","html_url":"https://github.com/jpulec","followers_url":"https://api.github.com/users/jpulec/followers","following_url":"https://api.github.com/users/jpulec/following{/other_user}","gists_url":"https://api.github.com/users/jpulec/gists{/gist_id}","starred_url":"https://api.github.com/users/jpulec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpulec/subscriptions","organizations_url":"https://api.github.com/users/jpulec/orgs","repos_url":"https://api.github.com/users/jpulec/repos","events_url":"https://api.github.com/users/jpulec/events{/privacy}","received_events_url":"https://api.github.com/users/jpulec/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-28T22:27:42Z","updated_at":"2016-01-22T20:50:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6af3257a31c1e5c362bcc71657182e89b813462","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/5886/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/5886/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/5886/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/29dcfb0754cbd9112d485346fa9e648b105c119f","head":{"label":"jpulec:ticket_25354","ref":"ticket_25354","sha":"29dcfb0754cbd9112d485346fa9e648b105c119f","user":{"login":"jpulec","id":407780,"avatar_url":"https://avatars.githubusercontent.com/u/407780?v=3","gravatar_id":"","url":"https://api.github.com/users/jpulec","html_url":"https://github.com/jpulec","followers_url":"https://api.github.com/users/jpulec/followers","following_url":"https://api.github.com/users/jpulec/following{/other_user}","gists_url":"https://api.github.com/users/jpulec/gists{/gist_id}","starred_url":"https://api.github.com/users/jpulec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpulec/subscriptions","organizations_url":"https://api.github.com/users/jpulec/orgs","repos_url":"https://api.github.com/users/jpulec/repos","events_url":"https://api.github.com/users/jpulec/events{/privacy}","received_events_url":"https://api.github.com/users/jpulec/received_events","type":"User","site_admin":false},"repo":{"id":8890009,"name":"django","full_name":"jpulec/django","owner":{"login":"jpulec","id":407780,"avatar_url":"https://avatars.githubusercontent.com/u/407780?v=3","gravatar_id":"","url":"https://api.github.com/users/jpulec","html_url":"https://github.com/jpulec","followers_url":"https://api.github.com/users/jpulec/followers","following_url":"https://api.github.com/users/jpulec/following{/other_user}","gists_url":"https://api.github.com/users/jpulec/gists{/gist_id}","starred_url":"https://api.github.com/users/jpulec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpulec/subscriptions","organizations_url":"https://api.github.com/users/jpulec/orgs","repos_url":"https://api.github.com/users/jpulec/repos","events_url":"https://api.github.com/users/jpulec/events{/privacy}","received_events_url":"https://api.github.com/users/jpulec/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpulec/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/jpulec/django","forks_url":"https://api.github.com/repos/jpulec/django/forks","keys_url":"https://api.github.com/repos/jpulec/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpulec/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpulec/django/teams","hooks_url":"https://api.github.com/repos/jpulec/django/hooks","issue_events_url":"https://api.github.com/repos/jpulec/django/issues/events{/number}","events_url":"https://api.github.com/repos/jpulec/django/events","assignees_url":"https://api.github.com/repos/jpulec/django/assignees{/user}","branches_url":"https://api.github.com/repos/jpulec/django/branches{/branch}","tags_url":"https://api.github.com/repos/jpulec/django/tags","blobs_url":"https://api.github.com/repos/jpulec/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpulec/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpulec/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpulec/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpulec/django/statuses/{sha}","languages_url":"https://api.github.com/repos/jpulec/django/languages","stargazers_url":"https://api.github.com/repos/jpulec/django/stargazers","contributors_url":"https://api.github.com/repos/jpulec/django/contributors","subscribers_url":"https://api.github.com/repos/jpulec/django/subscribers","subscription_url":"https://api.github.com/repos/jpulec/django/subscription","commits_url":"https://api.github.com/repos/jpulec/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpulec/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpulec/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpulec/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpulec/django/contents/{+path}","compare_url":"https://api.github.com/repos/jpulec/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpulec/django/merges","archive_url":"https://api.github.com/repos/jpulec/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpulec/django/downloads","issues_url":"https://api.github.com/repos/jpulec/django/issues{/number}","pulls_url":"https://api.github.com/repos/jpulec/django/pulls{/number}","milestones_url":"https://api.github.com/repos/jpulec/django/milestones{/number}","notifications_url":"https://api.github.com/repos/jpulec/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpulec/django/labels{/name}","releases_url":"https://api.github.com/repos/jpulec/django/releases{/id}","deployments_url":"https://api.github.com/repos/jpulec/django/deployments","created_at":"2013-03-19T21:39:45Z","updated_at":"2015-03-10T00:44:57Z","pushed_at":"2016-01-16T04:34:33Z","git_url":"git://github.com/jpulec/django.git","ssh_url":"git@github.com:jpulec/django.git","clone_url":"https://github.com/jpulec/django.git","svn_url":"https://github.com/jpulec/django","homepage":"http://www.djangoproject.com/","size":124997,"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":"6a4f13de27e2c46b6e516a01ba77fd4fe03d9dbe","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-01-22T19:40:36Z","pushed_at":"2016-01-22T20:44:34Z","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":181775,"stargazers_count":17674,"watchers_count":17674,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7177,"mirror_url":null,"open_issues_count":103,"forks":7177,"open_issues":103,"watchers":17674,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/5886"},"html":{"href":"https://github.com/django/django/pull/5886"},"issue":{"href":"https://api.github.com/repos/django/django/issues/5886"},"comments":{"href":"https://api.github.com/repos/django/django/issues/5886/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/5886/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/5886/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/29dcfb0754cbd9112d485346fa9e648b105c119f"}}}}