)]}'
{"openstack_dashboard/dashboards/project/access_and_security/security_groups/views.py":[{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"44dfdafb1fd0dfaa7356e5ac4b335bb0af9b8a3d","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        data \u003d self._get_data()"},{"line_number":57,"context_line":"        if data is None:"},{"line_number":58,"context_line":"            return []"},{"line_number":59,"context_line":"        return sorted(data.rules, key\u003dlambda rule: rule.from_port)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":62,"context_line":"        context \u003d super(DetailView, self).get_context_data(**kwargs)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_bdff6900","line":59,"updated":"2014-06-10 20:04:50.000000000","message":"Just one note - when the rule is ICMP, from_port contains the icmp_type 0 a value in the range(-1, 256). Here is the code in forms.py:\n\n            update_cleaned_data(\u0027from_port\u0027, icmp_type)\n            update_cleaned_data(\u0027to_port\u0027, icmp_code)\n\nMaybe the sorting here should take care of different meanings of from_port value for different rule types.","commit_id":"c8c39c5554eec160e9b319a4f97ee31b2e8c75e9"},{"author":{"_account_id":9659,"name":"Matt Wood","email":"matt.wood@hpe.com","username":"woodm1979"},"change_message_id":"bd3470f06273dae01bc115f553c8e156cfcaf383","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        data \u003d self._get_data()"},{"line_number":57,"context_line":"        if data is None:"},{"line_number":58,"context_line":"            return []"},{"line_number":59,"context_line":"        return sorted(data.rules, key\u003dlambda rule: rule.from_port)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":62,"context_line":"        context \u003d super(DetailView, self).get_context_data(**kwargs)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_5402c96f","line":59,"updated":"2014-06-10 17:02:22.000000000","message":"My preference would be to use operator.attrgetter, but it\u0027s not strong enough to warrant a -1.\nhttps://docs.python.org/2/library/operator.html#operator.attrgetter","commit_id":"c8c39c5554eec160e9b319a4f97ee31b2e8c75e9"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"aa0c8803380a3de6e1e8bc2617aeb4869bc13a7a","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        data \u003d self._get_data()"},{"line_number":57,"context_line":"        if data is None:"},{"line_number":58,"context_line":"            return []"},{"line_number":59,"context_line":"        return sorted(data.rules, key\u003dlambda rule: rule.from_port)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":62,"context_line":"        context \u003d super(DetailView, self).get_context_data(**kwargs)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_8817b6ed","line":59,"in_reply_to":"1ae5cdf2_bdff6900","updated":"2014-06-11 11:09:42.000000000","message":"@Matthew: Interesting, I didn\u0027t consider operator.attrgetter, since lambda does the job just fine, and without importing an additional module. Is there any advantage of using operator.attrgetter vs. lambda?\n\n@Tihomir: That\u0027s a good point and I think it makes sense to sort by protocol first and then by port number. I will change the behavior in an updated patch.","commit_id":"c8c39c5554eec160e9b319a4f97ee31b2e8c75e9"}]}
