GitHub PullRequestReviewCommentEvent at 2014-07-19 07:29:34
Repository: django
Actor: freakboy3742
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/15142548","id":15142548,"diff_hunk":"@@ -126,10 +126,12 @@ def add_update_values(self, values):\n         \"\"\"\n         values_seq = []\n         for name, val in six.iteritems(values):\n-            field, model, direct, m2m = self.get_meta().get_field_by_name(name)\n-            if not direct or m2m:\n+            field = self.get_meta().get_field(name, related_objects=True, related_m2m=True, virtual=True)\n+            direct = isinstance(field, Field) or hasattr(field, 'is_gfk')\n+            model = field.parent_model._meta.concrete_model\n+            if not direct or hasattr(field, 'is_m2m'):","path":"django/db/models/sql/subqueries.py","position":18,"original_position":18,"commit_id":"8ffd5e11b137d79cca62d0de5193f0b7bbf20e0e","original_commit_id":"8ffd5e11b137d79cca62d0de5193f0b7bbf20e0e","user":{"login":"freakboy3742","id":37345,"avatar_url":"https://avatars.githubusercontent.com/u/37345?","gravatar_id":"b91373320dbc3bc52fcd870d3b21748f","url":"https://api.github.com/users/freakboy3742","html_url":"https://github.com/freakboy3742","followers_url":"https://api.github.com/users/freakboy3742/followers","following_url":"https://api.github.com/users/freakboy3742/following{/other_user}","gists_url":"https://api.github.com/users/freakboy3742/gists{/gist_id}","starred_url":"https://api.github.com/users/freakboy3742/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freakboy3742/subscriptions","organizations_url":"https://api.github.com/users/freakboy3742/orgs","repos_url":"https://api.github.com/users/freakboy3742/repos","events_url":"https://api.github.com/users/freakboy3742/events{/privacy}","received_events_url":"https://api.github.com/users/freakboy3742/received_events","type":"User","site_admin":false},"body":"Either *all* fields should have an m2m property (because m2m is a fundamental property that a field can have), or none of them do. A hasattr check doesn't make sense here. ","created_at":"2014-07-19T07:29:34Z","updated_at":"2014-07-19T07:29:34Z","html_url":"https://github.com/django/django/pull/2894#discussion_r15142548","pull_request_url":"https://api.github.com/repos/django/django/pulls/2894","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/15142548"},"html":{"href":"https://github.com/django/django/pull/2894#discussion_r15142548"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/2894"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/2894","id":18102141,"html_url":"https://github.com/django/django/pull/2894","diff_url":"https://github.com/django/django/pull/2894.diff","patch_url":"https://github.com/django/django/pull/2894.patch","issue_url":"https://api.github.com/repos/django/django/issues/2894","number":2894,"state":"open","title":"[Soc2014] The new Options API","user":{"login":"PirosB3","id":847179,"avatar_url":"https://avatars.githubusercontent.com/u/847179?","gravatar_id":"d547949cc9256f649a3519c8a1673f14","url":"https://api.github.com/users/PirosB3","html_url":"https://github.com/PirosB3","followers_url":"https://api.github.com/users/PirosB3/followers","following_url":"https://api.github.com/users/PirosB3/following{/other_user}","gists_url":"https://api.github.com/users/PirosB3/gists{/gist_id}","starred_url":"https://api.github.com/users/PirosB3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PirosB3/subscriptions","organizations_url":"https://api.github.com/users/PirosB3/orgs","repos_url":"https://api.github.com/users/PirosB3/repos","events_url":"https://api.github.com/users/PirosB3/events{/privacy}","received_events_url":"https://api.github.com/users/PirosB3/received_events","type":"User","site_admin":false},"body":"# Main API\r\nOfficial Wiki page: https://code.djangoproject.com/wiki/new_meta_api\r\n\r\nget_fields(m2m, data, related_m2m, related_objects, virtual,\r\ninclude_parents, include_non_concrete, include_hidden, include_proxy) -> (field, field, ...)\r\n\r\nget_field(field_name, m2m, data, related_m2m, related_objects, virtual) -> field\r\n\r\n# Cached properties for fast access\r\nfields -> (field, field, ..)\r\nconcrete_fields -> (field, field, ...)\r\nlocal_concrete_fields -> (field, field, ...)\r\nfield_names (field_name, field_name, ..)\r\n\r\n# Benchmarks\r\n(compared to master)\r\n\r\n| Benchmark Name | Control | Experiment | Diff |\r\n| -------------- | ------- | ---------- | ---- |\r\n| url_resolve_flat_i18n_off | 0.3224664569 | 0.3128736854 | 0.0095927715 (2.97% faster) |\r\n| url_resolve_flat | 0.2262115002 | 0.2201457143 | 0.0060657859 (2.68% faster) |\r\n| query_prefetch_related | 0.1185187101 | 0.1131614804 | 0.0053572297 (4.52% faster) |\r\n| query_all | 0.0260368466 | 0.0244047880 | 0.0016320586 (6.27% faster) |\r\n| query_select_related | 0.0590585470 | 0.0582756639 | 0.0007828832 (1.33% faster) |\r\n| query_raw | 0.0150311589 | 0.0149269700 | 0.0001041889 (0.69% faster) |\r\n| query_distinct | 0.0003427148 | 0.0003322124 | 0.0000105023 (3.06% faster) |\r\n| url_resolve | 0.0174066782 | 0.0174011946 | 0.0000054836 (0.03% faster) |\r\n| template_render_simple | 0.0001164556 | 0.0001118183 | 0.0000046372 (3.98% faster) |\r\n| query_delete_related | 0.0003562689 | 0.0003521204 | 0.0000041485 (1.16% faster) |\r\n| form_create | 0.0001154184 | 0.0001116633 | 0.0000037551 (3.25% faster) |\r\n| model_creation | 0.0002620935 | 0.0002592921 | 0.0000028014 (1.07% faster) |\r\n| query_iterator | 0.0002910018 | 0.0002886057 | 0.0000023961 (0.82% faster) |\r\n| form_clean | 0.0000283957 | 0.0000273466 | 0.0000010490 (3.69% faster) |\r\n| url_resolve_nested | 0.0001253605 | 0.0001250029 | 0.0000003576 (0.29% faster) |\r\n| query_delete | 0.0002635837 | 0.0002634764 | 0.0000001073 (0.04% faster) |\r\n| raw_sql | 0.0000513077 | 0.0000515938 | -0.0000002861 (0.56% slower) |\r\n| template_render | 0.0123201489 | 0.0123205304 | -0.0000003815 (0.00% slower) |\r\n| query_none | 0.0001389146 | 0.0001396894 | -0.0000007749 (0.56% slower) |\r\n| query_all_multifield | 0.0442516685 | 0.0442527294 | -0.0000010610 (0.00% slower) |\r\n| multi_value_dict | 0.0001797199 | 0.0001827717 | -0.0000030518 (1.70% slower) |\r\n| query_count | 0.0002346754 | 0.0002384424 | -0.0000037670 (1.61% slower) |\r\n| locale_from_request | 0.0008673787 | 0.0008715868 | -0.0000042081 (0.49% slower) |\r\n| query_exclude | 0.0005133271 | 0.0005178809 | -0.0000045538 (0.89% slower) |\r\n| query_latest | 0.0003925323 | 0.0003977776 | -0.0000052452 (1.34% slower) |\r\n| model_delete | 0.0004462004 | 0.0004532099 | -0.0000070095 (1.57% slower) |\r\n| query_order_by | 0.0003699422 | 0.0003770232 | -0.0000070810 (1.91% slower) |\r\n| query_aggregate | 0.0003185034 | 0.0003258467 | -0.0000073433 (2.31% slower) |\r\n| default_middleware | 0.0004270792 | 0.0004346967 | -0.0000076175 (1.78% slower) |\r\n| query_filter | 0.0004306793 | 0.0004388094 | -0.0000081301 (1.89% slower) |\r\n| query_update | 0.0002333641 | 0.0002430677 | -0.0000097036 (4.16% slower) |\r\n| query_in_bulk | 0.0004901409 | 0.0005011201 | -0.0000109792 (2.24% slower) |\r\n| query_dates | 0.0005465746 | 0.0005576730 | -0.0000110984 (2.03% slower) |\r\n| query_annotate | 0.0006684303 | 0.0006795764 | -0.0000111461 (1.67% slower) |\r\n| query_values | 0.0003065467 | 0.0003197312 | -0.0000131845 (4.30% slower) |\r\n| query_complex_filter | 0.0001333117 | 0.0001471758 | -0.0000138640 (10.40% slower) |\r\n| query_values_list | 0.0002993703 | 0.0003140211 | -0.0000146508 (4.89% slower) |\r\n| template_compilation | 0.0005861163 | 0.0006127477 | -0.0000266314 (4.54% slower) |\r\n| query_get_or_create | 0.0013090134 | 0.0013397813 | -0.0000307679 (2.35% slower) |\r\n| l10n_render | 0.0063407421 | 0.0063731670 | -0.0000324249 (0.51% slower) |\r\n| query_exists | 0.0009287477 | 0.0009753466 | -0.0000465989 (5.02% slower) |\r\n| qs_filter_chaining | 0.0008348227 | 0.0009381652 | -0.0001033425 (12.38% slower) |\r\n| query_raw_deferred | 0.0182870388 | 0.0186469555 | -0.0003599167 (1.97% slower) |\r\n| model_save_new | 0.0142104745 | 0.0145826817 | -0.0003722072 (2.62% slower) |\r\n| model_save_existing | 0.0140855193 | 0.0145498991 | -0.0004643798 (3.30% slower) |\r\n| query_get | 0.0273179531 | 0.0280359745 | -0.0007180214 (2.63% slower) |\r\nSum of all benchmarks (bigger is better): 0.0212707281","created_at":"2014-07-08T13:37:41Z","updated_at":"2014-07-19T07:29:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66d387fa56e36bc42bd257f81b55aea29613f3ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/2894/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/2894/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments/{number}","comments_url":"https://api.github.com/repos/django/django/issues/2894/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/8ffd5e11b137d79cca62d0de5193f0b7bbf20e0e","head":{"label":"PirosB3:soc2014_meta_refactor_upgrade_flags_get_field","ref":"soc2014_meta_refactor_upgrade_flags_get_field","sha":"8ffd5e11b137d79cca62d0de5193f0b7bbf20e0e","user":{"login":"PirosB3","id":847179,"avatar_url":"https://avatars.githubusercontent.com/u/847179?","gravatar_id":"d547949cc9256f649a3519c8a1673f14","url":"https://api.github.com/users/PirosB3","html_url":"https://github.com/PirosB3","followers_url":"https://api.github.com/users/PirosB3/followers","following_url":"https://api.github.com/users/PirosB3/following{/other_user}","gists_url":"https://api.github.com/users/PirosB3/gists{/gist_id}","starred_url":"https://api.github.com/users/PirosB3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PirosB3/subscriptions","organizations_url":"https://api.github.com/users/PirosB3/orgs","repos_url":"https://api.github.com/users/PirosB3/repos","events_url":"https://api.github.com/users/PirosB3/events{/privacy}","received_events_url":"https://api.github.com/users/PirosB3/received_events","type":"User","site_admin":false},"repo":{"id":17481434,"name":"django","full_name":"PirosB3/django","owner":{"login":"PirosB3","id":847179,"avatar_url":"https://avatars.githubusercontent.com/u/847179?","gravatar_id":"d547949cc9256f649a3519c8a1673f14","url":"https://api.github.com/users/PirosB3","html_url":"https://github.com/PirosB3","followers_url":"https://api.github.com/users/PirosB3/followers","following_url":"https://api.github.com/users/PirosB3/following{/other_user}","gists_url":"https://api.github.com/users/PirosB3/gists{/gist_id}","starred_url":"https://api.github.com/users/PirosB3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PirosB3/subscriptions","organizations_url":"https://api.github.com/users/PirosB3/orgs","repos_url":"https://api.github.com/users/PirosB3/repos","events_url":"https://api.github.com/users/PirosB3/events{/privacy}","received_events_url":"https://api.github.com/users/PirosB3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PirosB3/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/PirosB3/django","forks_url":"https://api.github.com/repos/PirosB3/django/forks","keys_url":"https://api.github.com/repos/PirosB3/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PirosB3/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PirosB3/django/teams","hooks_url":"https://api.github.com/repos/PirosB3/django/hooks","issue_events_url":"https://api.github.com/repos/PirosB3/django/issues/events{/number}","events_url":"https://api.github.com/repos/PirosB3/django/events","assignees_url":"https://api.github.com/repos/PirosB3/django/assignees{/user}","branches_url":"https://api.github.com/repos/PirosB3/django/branches{/branch}","tags_url":"https://api.github.com/repos/PirosB3/django/tags","blobs_url":"https://api.github.com/repos/PirosB3/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PirosB3/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PirosB3/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/PirosB3/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PirosB3/django/statuses/{sha}","languages_url":"https://api.github.com/repos/PirosB3/django/languages","stargazers_url":"https://api.github.com/repos/PirosB3/django/stargazers","contributors_url":"https://api.github.com/repos/PirosB3/django/contributors","subscribers_url":"https://api.github.com/repos/PirosB3/django/subscribers","subscription_url":"https://api.github.com/repos/PirosB3/django/subscription","commits_url":"https://api.github.com/repos/PirosB3/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/PirosB3/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/PirosB3/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/PirosB3/django/issues/comments/{number}","contents_url":"https://api.github.com/repos/PirosB3/django/contents/{+path}","compare_url":"https://api.github.com/repos/PirosB3/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PirosB3/django/merges","archive_url":"https://api.github.com/repos/PirosB3/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PirosB3/django/downloads","issues_url":"https://api.github.com/repos/PirosB3/django/issues{/number}","pulls_url":"https://api.github.com/repos/PirosB3/django/pulls{/number}","milestones_url":"https://api.github.com/repos/PirosB3/django/milestones{/number}","notifications_url":"https://api.github.com/repos/PirosB3/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PirosB3/django/labels{/name}","releases_url":"https://api.github.com/repos/PirosB3/django/releases{/id}","created_at":"2014-03-06T15:01:29Z","updated_at":"2014-06-24T15:06:48Z","pushed_at":"2014-07-17T08:17:19Z","git_url":"git://github.com/PirosB3/django.git","ssh_url":"git@github.com:PirosB3/django.git","clone_url":"https://github.com/PirosB3/django.git","svn_url":"https://github.com/PirosB3/django","homepage":"http://www.djangoproject.com/","size":105508,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":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":"4e424084e6d796f7ed5f215330cd0b98287c1300","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?","gravatar_id":"fd542381031aa84dca86628ece84fc07","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?","gravatar_id":"fd542381031aa84dca86628ece84fc07","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":"2014-07-19T06:38:25Z","pushed_at":"2014-07-18T16:11:20Z","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":"http://www.djangoproject.com/","size":217505,"stargazers_count":10513,"watchers_count":10513,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":4026,"mirror_url":null,"open_issues_count":111,"forks":4026,"open_issues":111,"watchers":10513,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/2894"},"html":{"href":"https://github.com/django/django/pull/2894"},"issue":{"href":"https://api.github.com/repos/django/django/issues/2894"},"comments":{"href":"https://api.github.com/repos/django/django/issues/2894/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/2894/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/2894/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/8ffd5e11b137d79cca62d0de5193f0b7bbf20e0e"}}}}