{"action":"created","comment":{"url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/comments/23288881","id":23288881,"diff_hunk":"@@ -30,11 +27,11 @@ def __init__(self, autocomplete=None, registry=None, widget=None,\n                     autocomplete_js_attributes, extra_context)\n         kwargs['widget'] = widget\n \n-        parents = super(FieldBase, self).__self_class__.__bases__\n-        if ((forms.ModelChoiceField in parents or\n-                forms.ModelMultipleChoiceField in parents)\n-                and isinstance(self.autocomplete.choices, QuerySet)):\n-            kwargs['queryset'] = self.autocomplete.choices\n+        if 'queryset' not in kwargs:\n+            parents = super(FieldBase, self).__self_class__.__bases__\n+            if (forms.ModelChoiceField in parents or\n+                    forms.ModelMultipleChoiceField in parents):\n+                kwargs['queryset'] = self.autocomplete.choices","path":"autocomplete_light/fields.py","position":28,"original_position":28,"commit_id":"9614289d0fe7f80d980430bdb6bfbd6aaf905062","original_commit_id":"9614289d0fe7f80d980430bdb6bfbd6aaf905062","user":{"login":"jpic","id":94636,"avatar_url":"https://avatars.githubusercontent.com/u/94636?v=3","gravatar_id":"","url":"https://api.github.com/users/jpic","html_url":"https://github.com/jpic","followers_url":"https://api.github.com/users/jpic/followers","following_url":"https://api.github.com/users/jpic/following{/other_user}","gists_url":"https://api.github.com/users/jpic/gists{/gist_id}","starred_url":"https://api.github.com/users/jpic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpic/subscriptions","organizations_url":"https://api.github.com/users/jpic/orgs","repos_url":"https://api.github.com/users/jpic/repos","events_url":"https://api.github.com/users/jpic/events{/privacy}","received_events_url":"https://api.github.com/users/jpic/received_events","type":"User","site_admin":false},"body":"Well I really dislike how I coupled Model stuff into FieldBase, can't find out what was the reason for that ... so should we consider moving that part into ModelChoiceField ?","created_at":"2015-01-21T10:07:06Z","updated_at":"2015-01-21T10:07:06Z","html_url":"https://github.com/yourlabs/django-autocomplete-light/pull/360#discussion_r23288881","pull_request_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/360","_links":{"self":{"href":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/comments/23288881"},"html":{"href":"https://github.com/yourlabs/django-autocomplete-light/pull/360#discussion_r23288881"},"pull_request":{"href":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/360"}}},"pull_request":{"url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/360","id":27719666,"html_url":"https://github.com/yourlabs/django-autocomplete-light/pull/360","diff_url":"https://github.com/yourlabs/django-autocomplete-light/pull/360.diff","patch_url":"https://github.com/yourlabs/django-autocomplete-light/pull/360.patch","issue_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/issues/360","number":360,"state":"open","locked":false,"title":"Model choices from field queryset","user":{"login":"blueyed","id":9766,"avatar_url":"https://avatars.githubusercontent.com/u/9766?v=3","gravatar_id":"","url":"https://api.github.com/users/blueyed","html_url":"https://github.com/blueyed","followers_url":"https://api.github.com/users/blueyed/followers","following_url":"https://api.github.com/users/blueyed/following{/other_user}","gists_url":"https://api.github.com/users/blueyed/gists{/gist_id}","starred_url":"https://api.github.com/users/blueyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueyed/subscriptions","organizations_url":"https://api.github.com/users/blueyed/orgs","repos_url":"https://api.github.com/users/blueyed/repos","events_url":"https://api.github.com/users/blueyed/events{/privacy}","received_events_url":"https://api.github.com/users/blueyed/received_events","type":"User","site_admin":false},"body":"Followup of #305 against master.","created_at":"2015-01-20T22:42:45Z","updated_at":"2015-01-21T10:07:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"232e6201c42b291de83321f8bef1bee8db8fc48f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/360/commits","review_comments_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/360/comments","review_comment_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/comments/{number}","comments_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/issues/360/comments","statuses_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/statuses/9614289d0fe7f80d980430bdb6bfbd6aaf905062","head":{"label":"blueyed:model-choices-from-field-queryset","ref":"model-choices-from-field-queryset","sha":"9614289d0fe7f80d980430bdb6bfbd6aaf905062","user":{"login":"blueyed","id":9766,"avatar_url":"https://avatars.githubusercontent.com/u/9766?v=3","gravatar_id":"","url":"https://api.github.com/users/blueyed","html_url":"https://github.com/blueyed","followers_url":"https://api.github.com/users/blueyed/followers","following_url":"https://api.github.com/users/blueyed/following{/other_user}","gists_url":"https://api.github.com/users/blueyed/gists{/gist_id}","starred_url":"https://api.github.com/users/blueyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueyed/subscriptions","organizations_url":"https://api.github.com/users/blueyed/orgs","repos_url":"https://api.github.com/users/blueyed/repos","events_url":"https://api.github.com/users/blueyed/events{/privacy}","received_events_url":"https://api.github.com/users/blueyed/received_events","type":"User","site_admin":false},"repo":{"id":15254869,"name":"django-autocomplete-light","full_name":"blueyed/django-autocomplete-light","owner":{"login":"blueyed","id":9766,"avatar_url":"https://avatars.githubusercontent.com/u/9766?v=3","gravatar_id":"","url":"https://api.github.com/users/blueyed","html_url":"https://github.com/blueyed","followers_url":"https://api.github.com/users/blueyed/followers","following_url":"https://api.github.com/users/blueyed/following{/other_user}","gists_url":"https://api.github.com/users/blueyed/gists{/gist_id}","starred_url":"https://api.github.com/users/blueyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueyed/subscriptions","organizations_url":"https://api.github.com/users/blueyed/orgs","repos_url":"https://api.github.com/users/blueyed/repos","events_url":"https://api.github.com/users/blueyed/events{/privacy}","received_events_url":"https://api.github.com/users/blueyed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blueyed/django-autocomplete-light","description":"A fresh approach to autocomplete implementations, specially for Django. It supports templated autocompletes, foreign key, many to many, generic foreign key, generic many to many, autocompletes that depend on each other, etc, etc ... Status: stable.","fork":true,"url":"https://api.github.com/repos/blueyed/django-autocomplete-light","forks_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/forks","keys_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/teams","hooks_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/hooks","issue_events_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/issues/events{/number}","events_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/events","assignees_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/assignees{/user}","branches_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/branches{/branch}","tags_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/tags","blobs_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/git/refs{/sha}","trees_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/statuses/{sha}","languages_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/languages","stargazers_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/stargazers","contributors_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/contributors","subscribers_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/subscribers","subscription_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/subscription","commits_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/commits{/sha}","git_commits_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/git/commits{/sha}","comments_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/comments{/number}","issue_comment_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/issues/comments/{number}","contents_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/contents/{+path}","compare_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/merges","archive_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/downloads","issues_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/issues{/number}","pulls_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/pulls{/number}","milestones_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/milestones{/number}","notifications_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/labels{/name}","releases_url":"https://api.github.com/repos/blueyed/django-autocomplete-light/releases{/id}","created_at":"2013-12-17T13:17:00Z","updated_at":"2014-06-16T13:05:29Z","pushed_at":"2015-01-21T08:56:07Z","git_url":"git://github.com/blueyed/django-autocomplete-light.git","ssh_url":"git@github.com:blueyed/django-autocomplete-light.git","clone_url":"https://github.com/blueyed/django-autocomplete-light.git","svn_url":"https://github.com/blueyed/django-autocomplete-light","homepage":"http://django-autocomplete-light.rtfd.org","size":11081,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"yourlabs:master","ref":"master","sha":"92cc9187268ba25e58fdf33f771f3a6cc33404ce","user":{"login":"yourlabs","id":1040547,"avatar_url":"https://avatars.githubusercontent.com/u/1040547?v=3","gravatar_id":"","url":"https://api.github.com/users/yourlabs","html_url":"https://github.com/yourlabs","followers_url":"https://api.github.com/users/yourlabs/followers","following_url":"https://api.github.com/users/yourlabs/following{/other_user}","gists_url":"https://api.github.com/users/yourlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/yourlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yourlabs/subscriptions","organizations_url":"https://api.github.com/users/yourlabs/orgs","repos_url":"https://api.github.com/users/yourlabs/repos","events_url":"https://api.github.com/users/yourlabs/events{/privacy}","received_events_url":"https://api.github.com/users/yourlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":4213386,"name":"django-autocomplete-light","full_name":"yourlabs/django-autocomplete-light","owner":{"login":"yourlabs","id":1040547,"avatar_url":"https://avatars.githubusercontent.com/u/1040547?v=3","gravatar_id":"","url":"https://api.github.com/users/yourlabs","html_url":"https://github.com/yourlabs","followers_url":"https://api.github.com/users/yourlabs/followers","following_url":"https://api.github.com/users/yourlabs/following{/other_user}","gists_url":"https://api.github.com/users/yourlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/yourlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yourlabs/subscriptions","organizations_url":"https://api.github.com/users/yourlabs/orgs","repos_url":"https://api.github.com/users/yourlabs/repos","events_url":"https://api.github.com/users/yourlabs/events{/privacy}","received_events_url":"https://api.github.com/users/yourlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yourlabs/django-autocomplete-light","description":"A fresh approach to autocomplete implementations, specially for Django. It supports templated autocompletes, foreign key, many to many, generic foreign key, generic many to many, autocompletes that depend on each other, etc, etc ... Status: 2.x.x stable, 1.x.x deprecated.","fork":false,"url":"https://api.github.com/repos/yourlabs/django-autocomplete-light","forks_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/forks","keys_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/teams","hooks_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/hooks","issue_events_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/issues/events{/number}","events_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/events","assignees_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/assignees{/user}","branches_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/branches{/branch}","tags_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/tags","blobs_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/git/refs{/sha}","trees_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/statuses/{sha}","languages_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/languages","stargazers_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/stargazers","contributors_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/contributors","subscribers_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/subscribers","subscription_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/subscription","commits_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/commits{/sha}","git_commits_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/git/commits{/sha}","comments_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/comments{/number}","issue_comment_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/issues/comments/{number}","contents_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/contents/{+path}","compare_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/merges","archive_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/downloads","issues_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/issues{/number}","pulls_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls{/number}","milestones_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/milestones{/number}","notifications_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/labels{/name}","releases_url":"https://api.github.com/repos/yourlabs/django-autocomplete-light/releases{/id}","created_at":"2012-05-03T11:49:37Z","updated_at":"2015-01-20T22:35:15Z","pushed_at":"2015-01-21T08:44:02Z","git_url":"git://github.com/yourlabs/django-autocomplete-light.git","ssh_url":"git@github.com:yourlabs/django-autocomplete-light.git","clone_url":"https://github.com/yourlabs/django-autocomplete-light.git","svn_url":"https://github.com/yourlabs/django-autocomplete-light","homepage":"http://django-autocomplete-light.rtfd.org","size":14675,"stargazers_count":396,"watchers_count":396,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":116,"mirror_url":null,"open_issues_count":50,"forks":116,"open_issues":50,"watchers":396,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/360"},"html":{"href":"https://github.com/yourlabs/django-autocomplete-light/pull/360"},"issue":{"href":"https://api.github.com/repos/yourlabs/django-autocomplete-light/issues/360"},"comments":{"href":"https://api.github.com/repos/yourlabs/django-autocomplete-light/issues/360/comments"},"review_comments":{"href":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/360/comments"},"review_comment":{"href":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/yourlabs/django-autocomplete-light/pulls/360/commits"},"statuses":{"href":"https://api.github.com/repos/yourlabs/django-autocomplete-light/statuses/9614289d0fe7f80d980430bdb6bfbd6aaf905062"}}}}