GitHub PullRequestReviewCommentEvent at 2014-03-11 13:49:05
Repository: edx-platform
Actor: jimabramson
Payload: {"comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/10473083","id":10473083,"diff_hunk":"@@ -6,15 +6,22 @@\n \n class UserSerializer(serializers.HyperlinkedModelSerializer):\n     name = serializers.SerializerMethodField(\"get_name\")\n+    preferences = serializers.SerializerMethodField(\"get_preferences\")\n \n     def get_name(self, user):\n         profile = UserProfile.objects.get(user=user)\n         return profile.name\n \n+    def get_preferences(self, user):\n+        return dict([\n+            (pref.key, pref.value)\n+            for pref in UserPreference.objects.filter(user=user)","path":"common/djangoapps/user_api/serializers.py","position":13,"original_position":13,"commit_id":"e94cc02391e91b96e8cda72c8586ce5d26811ddd","original_commit_id":"e94cc02391e91b96e8cda72c8586ce5d26811ddd","user":{"login":"jimabramson","id":1349368,"avatar_url":"https://gravatar.com/avatar/89b343b23584e805d1b7e47b3460f097?d=https%3A%2F%2Fidenticons.github.com%2F5d6e6e326d616c6e800a530d6c2710f3.png&r=x","gravatar_id":"89b343b23584e805d1b7e47b3460f097","url":"https://api.github.com/users/jimabramson","html_url":"https://github.com/jimabramson","followers_url":"https://api.github.com/users/jimabramson/followers","following_url":"https://api.github.com/users/jimabramson/following{/other_user}","gists_url":"https://api.github.com/users/jimabramson/gists{/gist_id}","starred_url":"https://api.github.com/users/jimabramson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimabramson/subscriptions","organizations_url":"https://api.github.com/users/jimabramson/orgs","repos_url":"https://api.github.com/users/jimabramson/repos","events_url":"https://api.github.com/users/jimabramson/events{/privacy}","received_events_url":"https://api.github.com/users/jimabramson/received_events","type":"User","site_admin":false},"body":"i'm guessing that this new query is going to get executed once at a time for every user that is returned when a list of users is requested.  do you know if that's true, and if so, does the framework support any path to optimizing that?","created_at":"2014-03-11T13:49:05Z","updated_at":"2014-03-11T13:49:05Z","html_url":"https://github.com/edx/edx-platform/pull/2890#discussion_r10473083","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/2890","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/10473083"},"html":{"href":"https://github.com/edx/edx-platform/pull/2890#discussion_r10473083"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/2890"}}}}