)]}'
{"keystone/assignment/backends/sql.py":[{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"af1365cfa45a1f7337457682dc695de0bf846022","unresolved":false,"context_lines":[{"line_number":295,"context_line":"        project_refs \u003d query.all()"},{"line_number":296,"context_line":"        return [project_ref.to_dict() for project_ref in project_refs]"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def list_project_children(self, project_id):"},{"line_number":299,"context_line":"        with sql.transaction() as session:"},{"line_number":300,"context_line":"            project \u003d self._get_project(session, project_id).to_dict()"},{"line_number":301,"context_line":"            children \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_f370bc42","line":298,"updated":"2014-08-05 03:40:29.000000000","message":"This name was a little misleading for me. I was not expecting it to get all children recursively.","commit_id":"20680f50b36f0c80bb2750b0407269a7408071fe"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"c181225222d04fd83f2596daade2b32b48847562","unresolved":false,"context_lines":[{"line_number":295,"context_line":"        project_refs \u003d query.all()"},{"line_number":296,"context_line":"        return [project_ref.to_dict() for project_ref in project_refs]"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def list_project_children(self, project_id):"},{"line_number":299,"context_line":"        with sql.transaction() as session:"},{"line_number":300,"context_line":"            project \u003d self._get_project(session, project_id).to_dict()"},{"line_number":301,"context_line":"            children \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_78f9d681","line":298,"in_reply_to":"baada198_f370bc42","updated":"2014-08-05 14:28:00.000000000","message":"++\n\nrenamed to \"get_project_subtree\"","commit_id":"20680f50b36f0c80bb2750b0407269a7408071fe"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"af1365cfa45a1f7337457682dc695de0bf846022","unresolved":false,"context_lines":[{"line_number":300,"context_line":"            project \u003d self._get_project(session, project_id).to_dict()"},{"line_number":301,"context_line":"            children \u003d []"},{"line_number":302,"context_line":"            queue \u003d [project]"},{"line_number":303,"context_line":"            while queue:"},{"line_number":304,"context_line":"                project \u003d queue.pop()"},{"line_number":305,"context_line":"                project_children \u003d self._get_immediate_children(session,"},{"line_number":306,"context_line":"                                                                project[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_337874f7","line":303,"updated":"2014-08-05 03:40:29.000000000","message":"This algorithm will be very wasteful when there are lots of projects in a tree because it will do a query per project. It would be better to change this to be 1 query per level in the hierarchy. For example, given the project_id passed in to the method get its children. Then take that list of children and get all of their children in one query like: (query.filter(Project.id.in_(children_ids)). Do this until you have gotten to the leaf nodes in the tree.\n\nThere is one complication in that you may get too many children at a level to do the in_ method and may have to break it up. With a small hierarchy this would cut the queries in half. With a larger hierarchy it would be even better.","commit_id":"20680f50b36f0c80bb2750b0407269a7408071fe"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"c181225222d04fd83f2596daade2b32b48847562","unresolved":false,"context_lines":[{"line_number":300,"context_line":"            project \u003d self._get_project(session, project_id).to_dict()"},{"line_number":301,"context_line":"            children \u003d []"},{"line_number":302,"context_line":"            queue \u003d [project]"},{"line_number":303,"context_line":"            while queue:"},{"line_number":304,"context_line":"                project \u003d queue.pop()"},{"line_number":305,"context_line":"                project_children \u003d self._get_immediate_children(session,"},{"line_number":306,"context_line":"                                                                project[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_d8ef42b1","line":303,"in_reply_to":"baada198_337874f7","updated":"2014-08-05 14:28:00.000000000","message":"thanks for your comments. Modified the method to use the IN statement.","commit_id":"20680f50b36f0c80bb2750b0407269a7408071fe"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"af1365cfa45a1f7337457682dc695de0bf846022","unresolved":false,"context_lines":[{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def is_leaf_project(self, project_id):"},{"line_number":324,"context_line":"        with sql.transaction() as session:"},{"line_number":325,"context_line":"            project_refs \u003d self._get_immediate_children(session, project_id)"},{"line_number":326,"context_line":"            return not project_refs"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def get_roles_for_groups(self, group_ids, project_id\u003dNone, domain_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_049a506e","line":325,"updated":"2014-08-05 03:40:29.000000000","message":"Is there a more efficient way to do this? Just to know if there are any records you are querying the database and downloading them all.","commit_id":"20680f50b36f0c80bb2750b0407269a7408071fe"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"c181225222d04fd83f2596daade2b32b48847562","unresolved":false,"context_lines":[{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def is_leaf_project(self, project_id):"},{"line_number":324,"context_line":"        with sql.transaction() as session:"},{"line_number":325,"context_line":"            project_refs \u003d self._get_immediate_children(session, project_id)"},{"line_number":326,"context_line":"            return not project_refs"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def get_roles_for_groups(self, group_ids, project_id\u003dNone, domain_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_f84326ae","line":325,"in_reply_to":"baada198_049a506e","updated":"2014-08-05 14:28:00.000000000","message":"that was the most effective implementation we could think of \u003d(","commit_id":"20680f50b36f0c80bb2750b0407269a7408071fe"}],"keystone/token/providers/common.py":[{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"af1365cfa45a1f7337457682dc695de0bf846022","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        hierarchical_ids \u003d [project[\u0027id\u0027] for project in parents]"},{"line_number":151,"context_line":"        hierarchical_ids.append(project_id)"},{"line_number":152,"context_line":"        hierarchical_ids \u003d hierarchical_ids[::-1]"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        filtered_project \u003d {"},{"line_number":155,"context_line":"            \u0027id\u0027: project_ref[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_98979f38","line":152,"updated":"2014-08-05 03:40:29.000000000","message":"Is there any reason that you are not using \u0027reversed\u0027? I think it\u0027s easier to read for devs new to Python.","commit_id":"20680f50b36f0c80bb2750b0407269a7408071fe"}]}
