)]}'
{"mistral/api/controllers/resource.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    @property"},{"line_number":72,"context_line":"    def collection(self):"},{"line_number":73,"context_line":"        return getattr(self, self._type)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def has_next(self, limit):"},{"line_number":76,"context_line":"        \"\"\"Return whether resources has more items.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_59118d51","line":73,"updated":"2015-08-18 10:23:00.000000000","message":"What is this method for? What does self._type contain?","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    @property"},{"line_number":72,"context_line":"    def collection(self):"},{"line_number":73,"context_line":"        return getattr(self, self._type)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def has_next(self, limit):"},{"line_number":76,"context_line":"        \"\"\"Return whether resources has more items.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_4d4d193d","line":73,"in_reply_to":"fa1b9901_59118d51","updated":"2015-08-19 09:02:32.000000000","message":"For different resources(like workflows, tasks, actions, etc.), the response body contains different keys, I use this method to retrieve the resource list. Please see its value in the class Workflows.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        if not self.has_next(limit):"},{"line_number":82,"context_line":"            return wtypes.Unset"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        q_args \u003d \u0027\u0027.join([\u0027%s\u003d%s\u0026\u0027 % (key, kwargs[key]) for key in kwargs])"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        resource_args \u003d \u0027?%(args)slimit\u003d%(limit)d\u0026marker\u003d%(marker)s\u0027 % {"},{"line_number":87,"context_line":"            \u0027args\u0027: q_args,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_7e6d5703","line":84,"updated":"2015-08-18 10:23:00.000000000","message":"This way of iterating over a dict is not effective (because you iterate through it and use kwargs[key] which requires a dict search again). Use kwargs.items() instead to get key and value during iteration.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        if not self.has_next(limit):"},{"line_number":82,"context_line":"            return wtypes.Unset"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        q_args \u003d \u0027\u0027.join([\u0027%s\u003d%s\u0026\u0027 % (key, kwargs[key]) for key in kwargs])"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        resource_args \u003d \u0027?%(args)slimit\u003d%(limit)d\u0026marker\u003d%(marker)s\u0027 % {"},{"line_number":87,"context_line":"            \u0027args\u0027: q_args,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_0d5721cf","line":84,"in_reply_to":"fa1b9901_7e6d5703","updated":"2015-08-19 09:02:32.000000000","message":"done","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"}],"mistral/api/controllers/v2/types.py":[{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"2741968f55ed8180443d38e0fa0ec60ff953218f","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from mistral import exceptions"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class UuidType(wtypes.UserType):"},{"line_number":24,"context_line":"    \"\"\"A simple UUID type.\"\"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    basetype \u003d wtypes.text"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_dae7e93e","line":23,"updated":"2015-07-20 13:57:04.000000000","message":"for what we need this kind of implmentation of UUIDType ? It is already in WSME package - https://github.com/stackforge/wsme/blob/0.7.0/wsme/types.py#L261","commit_id":"7ea1ae875bb18f04626e75f0f7c26327d76db0ad"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"2312963eab1a72d95a2d9be795bad8a8adfbd454","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from mistral import exceptions"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class UuidType(wtypes.UserType):"},{"line_number":24,"context_line":"    \"\"\"A simple UUID type.\"\"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    basetype \u003d wtypes.text"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_ce1cef15","line":23,"in_reply_to":"3a50d1a3_dae7e93e","updated":"2015-07-21 01:27:37.000000000","message":"ooh, yes, thanks, just remember there was a bug for some native types, but forget that, it was already fixed.","commit_id":"7ea1ae875bb18f04626e75f0f7c26327d76db0ad"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"926a7150e7f6508d0024a2cad0afe2b9f6437829","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        return ListType.validate(value)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class UniqueListType(ListType):"},{"line_number":45,"context_line":"    \"\"\"A simple list type with no duplicate items.\"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    name \u003d \u0027uniquelist\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_89b84c2c","line":44,"updated":"2015-07-24 09:56:08.000000000","message":"Hmm.. It seems you renamed this class. Just interesting, but why?","commit_id":"373243216fcff0fd136984f287d84d7e335da86a"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"c0c4c13904f3939dfc0d4cfa4033e4bc6f2d0e58","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        return ListType.validate(value)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class UniqueListType(ListType):"},{"line_number":45,"context_line":"    \"\"\"A simple list type with no duplicate items.\"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    name \u003d \u0027uniquelist\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_a97d08b3","line":44,"in_reply_to":"3a50d1a3_89b84c2c","updated":"2015-07-24 10:08:17.000000000","message":"UniqueList is more accurate, since I need to keep the sort_keys order, with no duplicate items at the same time. The previous type is for Set, but Set is unordered.","commit_id":"373243216fcff0fd136984f287d84d7e335da86a"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"d4dc305006eef6b9803f59bd798f7d19e76442de","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        return ListType.validate(value)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class UniqueListType(ListType):"},{"line_number":45,"context_line":"    \"\"\"A simple list type with no duplicate items.\"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    name \u003d \u0027uniquelist\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_a468cd88","line":44,"in_reply_to":"3a50d1a3_a97d08b3","updated":"2015-07-24 10:14:50.000000000","message":"ok, got it!","commit_id":"373243216fcff0fd136984f287d84d7e335da86a"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"5c6daaa3dc7082203e3c9968858998aa0575ac4b","unresolved":false,"context_lines":[{"line_number":76,"context_line":"class UuidType(wtypes.UserType):"},{"line_number":77,"context_line":"    \"\"\"A simple UUID type."},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    The builtin UuidType class in wsme.types doesn\u0027t work properly with pecan."},{"line_number":80,"context_line":"    \"\"\""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    basetype \u003d wtypes.text"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_9be04bfc","line":79,"updated":"2015-07-27 09:18:12.000000000","message":"Really? why?","commit_id":"a1a3cfc125662be2153384c961fd0a12e566b0c4"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        :returns: A list of values."},{"line_number":34,"context_line":"        \"\"\""},{"line_number":35,"context_line":"        items \u003d [v.strip().lower() for v in six.text_type(value).split(\u0027,\u0027)]"},{"line_number":36,"context_line":"        # filter() to remove empty items"},{"line_number":37,"context_line":"        return filter(None, items)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_d9a03df7","line":36,"updated":"2015-08-18 10:23:00.000000000","message":"1. Add a period at the end of the comment.\n2. Insert a blank line before \u0027return\u0027 statement.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        :returns: A list of values."},{"line_number":34,"context_line":"        \"\"\""},{"line_number":35,"context_line":"        items \u003d [v.strip().lower() for v in six.text_type(value).split(\u0027,\u0027)]"},{"line_number":36,"context_line":"        # filter() to remove empty items"},{"line_number":37,"context_line":"        return filter(None, items)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_8580e547","line":36,"in_reply_to":"fa1b9901_d9a03df7","updated":"2015-08-19 09:02:32.000000000","message":"Done","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        \"\"\""},{"line_number":35,"context_line":"        items \u003d [v.strip().lower() for v in six.text_type(value).split(\u0027,\u0027)]"},{"line_number":36,"context_line":"        # filter() to remove empty items"},{"line_number":37,"context_line":"        return filter(None, items)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @staticmethod"},{"line_number":40,"context_line":"    def frombasetype(value):"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_b9a1c9ab","line":37,"updated":"2015-08-18 10:23:00.000000000","message":"I don\u0027t quite understand why method called \"validate\" actually converts the input string into a list? Isn\u0027t it just supposed to validate it?\n\nAnother related question: what is the life-cycle of a user type? In what order wsme calls these methods? If it just calls \"frombasetype\" then it\u0027s ok, validate() will be called just once. If it first calls \"validate\" and then \"frombasetype\" then method \"validate\" will be called twice which doesn\u0027t look good to me.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        \"\"\""},{"line_number":35,"context_line":"        items \u003d [v.strip().lower() for v in six.text_type(value).split(\u0027,\u0027)]"},{"line_number":36,"context_line":"        # filter() to remove empty items"},{"line_number":37,"context_line":"        return filter(None, items)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @staticmethod"},{"line_number":40,"context_line":"    def frombasetype(value):"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_656ef102","line":37,"in_reply_to":"fa1b9901_b9a1c9ab","updated":"2015-08-19 09:02:32.000000000","message":"\u0027frombasetype\u0027 and \u0027validate\u0027 are both the function names of base class, they are called independently in different scenarios.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def frombasetype(value):"},{"line_number":41,"context_line":"        if value is None:"},{"line_number":42,"context_line":"            return None"},{"line_number":43,"context_line":"        return ListType.validate(value)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class UniqueListType(ListType):"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_39de196e","line":43,"updated":"2015-08-18 10:23:00.000000000","message":"The whole method could be collapsed into a single line:\n\nreturn ListType.validate(value) if value else None","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def frombasetype(value):"},{"line_number":41,"context_line":"        if value is None:"},{"line_number":42,"context_line":"            return None"},{"line_number":43,"context_line":"        return ListType.validate(value)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class UniqueListType(ListType):"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_c5357df7","line":43,"in_reply_to":"fa1b9901_39de196e","updated":"2015-08-19 09:02:32.000000000","message":"Renat, we can\u0027t do this, in case the value is emtpy string.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        # NOTE(xylan): The reason of assigning seen.add to seen_add instead of"},{"line_number":63,"context_line":"        # just calling seen.add is resolving seen.add each iteration is more"},{"line_number":64,"context_line":"        # costly than resolving a local variable."},{"line_number":65,"context_line":"        seen_add \u003d seen.add"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        return [x for x in items if not (x in seen or seen_add(x))]"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_cb794095","line":65,"updated":"2015-08-18 10:23:00.000000000","message":"Come on! :) I don\u0027t really believe it\u0027s more costly to resolve seen.add. Lingxian, it seems like you\u0027re trying to predict how python interpreter optimization work in such cases. Interpreter can easily optimize this (decent implementation actually do that as far as I\u0027m aware of, I dug things like that before..).\n\nYour comment itself made the code much more complicated than if you just used seen.add inside a list generator. I strongly believe that we shouldn\u0027t overoptimize in such cases at cost of loosing code readability. I almost insist you to remove this comment and use seen.add() directly.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        # NOTE(xylan): The reason of assigning seen.add to seen_add instead of"},{"line_number":63,"context_line":"        # just calling seen.add is resolving seen.add each iteration is more"},{"line_number":64,"context_line":"        # costly than resolving a local variable."},{"line_number":65,"context_line":"        seen_add \u003d seen.add"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        return [x for x in items if not (x in seen or seen_add(x))]"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_5b587032","line":65,"in_reply_to":"fa1b9901_cb794095","updated":"2015-08-19 09:02:32.000000000","message":"Renat, no problem for your suggestion. I just saw this \u0027optimization\u0027 trick in stackoverflow(I forget when I saw it, it have been a long time)","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @staticmethod"},{"line_number":70,"context_line":"    def frombasetype(value):"},{"line_number":71,"context_line":"        if value is None:"},{"line_number":72,"context_line":"            return None"},{"line_number":73,"context_line":"        return UniqueListType.validate(value)"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_39cb7955","line":71,"updated":"2015-08-18 10:23:00.000000000","message":"The whole method could be collapsed into a single line:\n\nreturn UniqueListType.validate(value) if value else None","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        return value"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    @staticmethod"},{"line_number":95,"context_line":"    def frombasetype(value):"},{"line_number":96,"context_line":"        if value is None:"},{"line_number":97,"context_line":"            return None"},{"line_number":98,"context_line":"        return UuidType.validate(value)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_194c75c6","line":95,"updated":"2015-08-18 10:23:00.000000000","message":"The whole method could be collapsed into a single line:\n\nreturn UuidType.validate(value) if value else None","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"}],"mistral/api/controllers/v2/workflow.py":[{"author":{"_account_id":8592,"name":"Anastasia Kuznetsova","email":"akuznetsova@mirantis.com","username":"nastya-kuz"},"change_message_id":"dc552c3aac40ec57e213326c8c2d360631c88a07","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    @rest_utils.wrap_pecan_controller_exception"},{"line_number":184,"context_line":"    @wsme_pecan.wsexpose(Workflows, types.uuid, int, types.settype,"},{"line_number":185,"context_line":"                         types.listtype)"},{"line_number":186,"context_line":"    def get_all(self, marker\u003dNone, limit\u003dNone, sort_keys\u003d\u0027name\u0027,"},{"line_number":187,"context_line":"                sort_dirs\u003d\u0027asc\u0027):"},{"line_number":188,"context_line":"        \"\"\"Return a list of workflows."},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_7a4b3c5a","line":186,"updated":"2015-07-20 11:21:56.000000000","message":"In other methods where you pass the same parameters (get_wf_definition, _paginate_query) the order of arguments is following: limit, marker, sort_keys, sort_dirs. Maybe you can use the same argument order here, just to be consistent ?","commit_id":"a90989dcb2419e8b769ecdf89526e14f20576365"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"5c537f69685a6f0ef3f6b5e7ce71210711be2323","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    @rest_utils.wrap_pecan_controller_exception"},{"line_number":184,"context_line":"    @wsme_pecan.wsexpose(Workflows, types.uuid, int, types.settype,"},{"line_number":185,"context_line":"                         types.listtype)"},{"line_number":186,"context_line":"    def get_all(self, marker\u003dNone, limit\u003dNone, sort_keys\u003d\u0027name\u0027,"},{"line_number":187,"context_line":"                sort_dirs\u003d\u0027asc\u0027):"},{"line_number":188,"context_line":"        \"\"\"Return a list of workflows."},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a50d1a3_c9f16dcf","line":186,"in_reply_to":"3a50d1a3_7a4b3c5a","updated":"2015-07-20 13:02:52.000000000","message":"Done","commit_id":"a90989dcb2419e8b769ecdf89526e14f20576365"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"2741968f55ed8180443d38e0fa0ec60ff953218f","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    workflows \u003d [Workflow]"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def __init__(self, wfs\u003dNone, **kwargs):"},{"line_number":94,"context_line":"        self._type \u003d \u0027workflows\u0027"},{"line_number":95,"context_line":"        if wfs:"},{"line_number":96,"context_line":"            self.workflows \u003d wfs"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_af8d0133","line":93,"updated":"2015-07-20 13:57:04.000000000","message":"Here should be call to super class, I think.","commit_id":"7ea1ae875bb18f04626e75f0f7c26327d76db0ad"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"2312963eab1a72d95a2d9be795bad8a8adfbd454","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    workflows \u003d [Workflow]"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def __init__(self, wfs\u003dNone, **kwargs):"},{"line_number":94,"context_line":"        self._type \u003d \u0027workflows\u0027"},{"line_number":95,"context_line":"        if wfs:"},{"line_number":96,"context_line":"            self.workflows \u003d wfs"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_2e7a33f2","line":93,"in_reply_to":"3a50d1a3_af8d0133","updated":"2015-07-21 01:27:37.000000000","message":"Done","commit_id":"7ea1ae875bb18f04626e75f0f7c26327d76db0ad"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"2741968f55ed8180443d38e0fa0ec60ff953218f","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    def __init__(self, wfs\u003dNone, **kwargs):"},{"line_number":94,"context_line":"        self._type \u003d \u0027workflows\u0027"},{"line_number":95,"context_line":"        if wfs:"},{"line_number":96,"context_line":"            self.workflows \u003d wfs"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    @staticmethod"},{"line_number":99,"context_line":"    def convert_with_links(workflows, limit, url\u003dNone, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_fab6653c","line":96,"updated":"2015-07-20 13:57:04.000000000","message":"btw, do we really need this? It seems there is the same in the base class - https://github.com/stackforge/wsme/blob/master/wsme/types.py#L768","commit_id":"7ea1ae875bb18f04626e75f0f7c26327d76db0ad"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"2312963eab1a72d95a2d9be795bad8a8adfbd454","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    def __init__(self, wfs\u003dNone, **kwargs):"},{"line_number":94,"context_line":"        self._type \u003d \u0027workflows\u0027"},{"line_number":95,"context_line":"        if wfs:"},{"line_number":96,"context_line":"            self.workflows \u003d wfs"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    @staticmethod"},{"line_number":99,"context_line":"    def convert_with_links(workflows, limit, url\u003dNone, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_4e677f25","line":96,"in_reply_to":"3a50d1a3_fab6653c","updated":"2015-07-21 01:27:37.000000000","message":"yes, if init() method of parent class is called, we could remove this.","commit_id":"7ea1ae875bb18f04626e75f0f7c26327d76db0ad"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"e96d76b5b2cde17351cd8cdde7e299e92ec06cf7","unresolved":false,"context_lines":[{"line_number":106,"context_line":"    def sample(cls):"},{"line_number":107,"context_line":"        workflows_sample \u003d cls()"},{"line_number":108,"context_line":"        workflows_sample.workflows \u003d [Workflow.sample()]"},{"line_number":109,"context_line":"        workflows_sample.next \u003d \"http://localhost:8989/v2/workflows?\" \\"},{"line_number":110,"context_line":"                                \"sort_keys\u003did,name\u0026\" \\"},{"line_number":111,"context_line":"                                \"sort_dirs\u003dasc,desc\u0026limit\u003d10\u0026\" \\"},{"line_number":112,"context_line":"                                \"marker\u003d123e4567-e89b-12d3-a456-426655440000\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a50d1a3_add718be","line":109,"updated":"2015-07-21 10:05:32.000000000","message":"Soft: Use parentheses instead of back slash.","commit_id":"b6d28cf24a4d772d3dc8c8168b3f9f6ea5ca6804"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"926a7150e7f6508d0024a2cad0afe2b9f6437829","unresolved":false,"context_lines":[{"line_number":106,"context_line":"    def sample(cls):"},{"line_number":107,"context_line":"        workflows_sample \u003d cls()"},{"line_number":108,"context_line":"        workflows_sample.workflows \u003d [Workflow.sample()]"},{"line_number":109,"context_line":"        workflows_sample.next \u003d \"http://localhost:8989/v2/workflows?\" \\"},{"line_number":110,"context_line":"                                \"sort_keys\u003did,name\u0026\" \\"},{"line_number":111,"context_line":"                                \"sort_dirs\u003dasc,desc\u0026limit\u003d10\u0026\" \\"},{"line_number":112,"context_line":"                                \"marker\u003d123e4567-e89b-12d3-a456-426655440000\""}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_69862067","line":109,"updated":"2015-07-24 09:56:08.000000000","message":"Soft: Use parentheses instead of back slashes.","commit_id":"373243216fcff0fd136984f287d84d7e335da86a"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        wf_collection \u003d Workflows()"},{"line_number":101,"context_line":"        wf_collection.workflows \u003d workflows"},{"line_number":102,"context_line":"        wf_collection.next \u003d wf_collection.get_next(limit, url\u003durl, **kwargs)"},{"line_number":103,"context_line":"        return wf_collection"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    @classmethod"},{"line_number":106,"context_line":"    def sample(cls):"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_ab9bacc8","line":103,"updated":"2015-08-18 10:23:00.000000000","message":"Add a blank line before \"return\".","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        wf_collection \u003d Workflows()"},{"line_number":101,"context_line":"        wf_collection.workflows \u003d workflows"},{"line_number":102,"context_line":"        wf_collection.next \u003d wf_collection.get_next(limit, url\u003durl, **kwargs)"},{"line_number":103,"context_line":"        return wf_collection"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    @classmethod"},{"line_number":106,"context_line":"    def sample(cls):"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_9e891629","line":103,"in_reply_to":"fa1b9901_ab9bacc8","updated":"2015-08-19 09:02:32.000000000","message":"Done","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        rest_utils.validate_query_params(limit, sort_keys, sort_dirs)"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        marker_obj \u003d None"},{"line_number":209,"context_line":"        if marker:"},{"line_number":210,"context_line":"            marker_obj \u003d db_api.get_workflow_definition_by_id(marker)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        db_workflows \u003d db_api.get_workflow_definitions("}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_8bf828e7","line":209,"updated":"2015-08-18 10:23:00.000000000","message":"Put a blank line before \"if\".","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        rest_utils.validate_query_params(limit, sort_keys, sort_dirs)"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        marker_obj \u003d None"},{"line_number":209,"context_line":"        if marker:"},{"line_number":210,"context_line":"            marker_obj \u003d db_api.get_workflow_definition_by_id(marker)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        db_workflows \u003d db_api.get_workflow_definitions("}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_fe9b7270","line":209,"in_reply_to":"fa1b9901_8bf828e7","updated":"2015-08-19 09:02:32.000000000","message":"Done","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        workflows_list \u003d [Workflow.from_dict(db_model.to_dict())"},{"line_number":220,"context_line":"                          for db_model in db_workflows]"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        return Workflows.convert_with_links("},{"line_number":223,"context_line":"            workflows_list,"},{"line_number":224,"context_line":"            limit,"},{"line_number":225,"context_line":"            pecan.request.host_url,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_cb6380b0","line":222,"updated":"2015-08-18 10:23:00.000000000","message":"Although it\u0027s ok at this point when we just have one resource type paginated please think how we could optimize the code in terms of not repeating this convert_with_links() call for each and every resource type.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        workflows_list \u003d [Workflow.from_dict(db_model.to_dict())"},{"line_number":220,"context_line":"                          for db_model in db_workflows]"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        return Workflows.convert_with_links("},{"line_number":223,"context_line":"            workflows_list,"},{"line_number":224,"context_line":"            limit,"},{"line_number":225,"context_line":"            pecan.request.host_url,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_dea0eea1","line":222,"in_reply_to":"fa1b9901_cb6380b0","updated":"2015-08-19 09:02:32.000000000","message":"ok, np","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"}],"mistral/db/v2/sqlalchemy/api.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":267,"context_line":"    query \u003d _secure_query(models.WorkflowDefinition)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"    try:"},{"line_number":270,"context_line":"        return _paginate_query(models.WorkflowDefinition, limit, marker,"},{"line_number":271,"context_line":"                               sort_keys, sort_dirs, query)"},{"line_number":272,"context_line":"    except Exception as e:"},{"line_number":273,"context_line":"        raise exc.DBQueryEntry("}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_137f74ab","line":270,"updated":"2015-08-18 10:23:00.000000000","message":"Soft: I prefer one arg on each line. Not critical.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":267,"context_line":"    query \u003d _secure_query(models.WorkflowDefinition)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"    try:"},{"line_number":270,"context_line":"        return _paginate_query(models.WorkflowDefinition, limit, marker,"},{"line_number":271,"context_line":"                               sort_keys, sort_dirs, query)"},{"line_number":272,"context_line":"    except Exception as e:"},{"line_number":273,"context_line":"        raise exc.DBQueryEntry("}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_53ccda69","line":270,"in_reply_to":"fa1b9901_137f74ab","updated":"2015-08-19 09:02:32.000000000","message":"Done","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"}],"mistral/exceptions.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    message \u003d \"Database object already exists\""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"class DBQueryEntry(MistralException):"},{"line_number":68,"context_line":"    http_code \u003d 400"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_9ecf0bb0","line":67,"updated":"2015-08-18 10:23:00.000000000","message":"I\u0027m not ok with the name of this exception. It doesn\u0027t reflect a corresponding problem.\n\nGenerally, I think we need to end all exception names with \"Exception\" or \"Error\" to show explicitly that this is an exception. From that perspective we need to rename DBDuplicateEntry to DBDuplicateEntryException.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    message \u003d \"Database object already exists\""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"class DBQueryEntry(MistralException):"},{"line_number":68,"context_line":"    http_code \u003d 400"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_5e0a9e22","line":67,"in_reply_to":"fa1b9901_9ecf0bb0","updated":"2015-08-19 09:02:32.000000000","message":"Done","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"}],"mistral/tests/unit/api/v2/test_workflows.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"0af3ff4aa935ae21ab61bfba1c4c43ea118eb541","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"        self.assertEqual(resp.status_int, 400)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        self.assertIn("},{"line_number":367,"context_line":"            \"Unknown sort direction\","},{"line_number":368,"context_line":"            resp.body"},{"line_number":369,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_7eb477f1","line":366,"updated":"2015-08-18 10:23:00.000000000","message":"Seems like this call could fit into a single line.","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"063e02ebd5352a836264bdba025cff3cbef5e92c","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"        self.assertEqual(resp.status_int, 400)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        self.assertIn("},{"line_number":367,"context_line":"            \"Unknown sort direction\","},{"line_number":368,"context_line":"            resp.body"},{"line_number":369,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa1b9901_6d6fbd92","line":366,"in_reply_to":"fa1b9901_7eb477f1","updated":"2015-08-19 09:02:32.000000000","message":"Done","commit_id":"592ddf3a71c4a66a95540d42fc2fcb74749f0e14"}],"mistral/utils/rest_utils.py":[{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"9235669099f0ebc1b87d4ae87e3cb78a468ba604","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def validate_query_params(limit, sort_keys, sort_dirs):"},{"line_number":56,"context_line":"    if limit is not None and limit \u003c\u003d 0:"},{"line_number":57,"context_line":"        raise exc.ClientSideError(\"Limit must be positive.\")"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    if len(sort_keys) !\u003d len(sort_dirs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_c2915454","line":56,"updated":"2015-07-24 06:50:36.000000000","message":"\u0027limit\u0027 should be an integer.\n\nneed to check int(limit) then check limit \u003c\u003d 0.","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"e34ea05950f1d4be8f9c3e02f5088fd29d4f001e","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def validate_query_params(limit, sort_keys, sort_dirs):"},{"line_number":56,"context_line":"    if limit is not None and limit \u003c\u003d 0:"},{"line_number":57,"context_line":"        raise exc.ClientSideError(\"Limit must be positive.\")"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    if len(sort_keys) !\u003d len(sort_dirs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_ce12da58","line":56,"in_reply_to":"3a50d1a3_5d33e5f6","updated":"2015-07-24 09:27:27.000000000","message":"Appreciate your explanation, Nikolay","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"be8ab73e57960326d35f36a183658ad53bd16ed9","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def validate_query_params(limit, sort_keys, sort_dirs):"},{"line_number":56,"context_line":"    if limit is not None and limit \u003c\u003d 0:"},{"line_number":57,"context_line":"        raise exc.ClientSideError(\"Limit must be positive.\")"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    if len(sort_keys) !\u003d len(sort_dirs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_9d1f2d09","line":56,"in_reply_to":"3a50d1a3_5d33e5f6","updated":"2015-07-24 07:26:59.000000000","message":"ok, fair enough.","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"e5eb82b44a8f4330fb69ddda2bdf2e56feaa68b6","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def validate_query_params(limit, sort_keys, sort_dirs):"},{"line_number":56,"context_line":"    if limit is not None and limit \u003c\u003d 0:"},{"line_number":57,"context_line":"        raise exc.ClientSideError(\"Limit must be positive.\")"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    if len(sort_keys) !\u003d len(sort_dirs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_5d33e5f6","line":56,"in_reply_to":"3a50d1a3_c2915454","updated":"2015-07-24 07:13:07.000000000","message":"It is not neccessary to do that. All these params are validated on type before checking its value in workflow.py, line 184. It is WSME responsibility.","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"9235669099f0ebc1b87d4ae87e3cb78a468ba604","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    if limit is not None and limit \u003c\u003d 0:"},{"line_number":57,"context_line":"        raise exc.ClientSideError(\"Limit must be positive.\")"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    if len(sort_keys) !\u003d len(sort_dirs):"},{"line_number":60,"context_line":"        raise exc.ClientSideError(\"Length of sort_keys and sort_dirs must be \""},{"line_number":61,"context_line":"                                  \"equal.\")"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_b7956889","line":59,"updated":"2015-07-24 06:50:36.000000000","message":"I think we should allow len(sort_keys) \u003e len(sort_dirs) here, and ensure the length match by appending default sort direction to sort_dirs.\n\nAs in many cases users just want to specify sort keys and use default sort direction, make sense?","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"e5eb82b44a8f4330fb69ddda2bdf2e56feaa68b6","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    if limit is not None and limit \u003c\u003d 0:"},{"line_number":57,"context_line":"        raise exc.ClientSideError(\"Limit must be positive.\")"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    if len(sort_keys) !\u003d len(sort_dirs):"},{"line_number":60,"context_line":"        raise exc.ClientSideError(\"Length of sort_keys and sort_dirs must be \""},{"line_number":61,"context_line":"                                  \"equal.\")"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_9d408d37","line":59,"in_reply_to":"3a50d1a3_b7956889","updated":"2015-07-24 07:13:07.000000000","message":"Agree with Zhenguo.","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"e34ea05950f1d4be8f9c3e02f5088fd29d4f001e","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    if limit is not None and limit \u003c\u003d 0:"},{"line_number":57,"context_line":"        raise exc.ClientSideError(\"Limit must be positive.\")"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    if len(sort_keys) !\u003d len(sort_dirs):"},{"line_number":60,"context_line":"        raise exc.ClientSideError(\"Length of sort_keys and sort_dirs must be \""},{"line_number":61,"context_line":"                                  \"equal.\")"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_6e2aa680","line":59,"in_reply_to":"3a50d1a3_b7956889","updated":"2015-07-24 09:27:27.000000000","message":"Done","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"9235669099f0ebc1b87d4ae87e3cb78a468ba604","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                                  \"equal.\")"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    for sort_dir in sort_dirs:"},{"line_number":64,"context_line":"        if sort_dir not in [\u0027asc\u0027, \u0027desc\u0027]:"},{"line_number":65,"context_line":"            raise exc.ClientSideError(\"Unknown sort direction, must be \u0027desc\u0027 \""},{"line_number":66,"context_line":"                                      \"or \u0027asc\u0027\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_37e87816","line":64,"updated":"2015-07-24 06:50:36.000000000","message":"please check whether sort key is valid here as well, otherwise db side will raise exceptions.\n\n  if sort_key not in [\u0027name\u0027, \u0027id\u0027, ...]","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"e5eb82b44a8f4330fb69ddda2bdf2e56feaa68b6","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                                  \"equal.\")"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    for sort_dir in sort_dirs:"},{"line_number":64,"context_line":"        if sort_dir not in [\u0027asc\u0027, \u0027desc\u0027]:"},{"line_number":65,"context_line":"            raise exc.ClientSideError(\"Unknown sort direction, must be \u0027desc\u0027 \""},{"line_number":66,"context_line":"                                      \"or \u0027asc\u0027\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_ddc855ab","line":64,"in_reply_to":"3a50d1a3_37e87816","updated":"2015-07-24 07:13:07.000000000","message":"Disagree. I think it is also not necessary because this function is generic and is not related to any specific mistral resource type. Otherwise in future we should specify validation for all fields of all resources, it is just not flexible, IMO.\n\nI\u0027d prefer to let db layer raise the exception for unexisting keys.","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"e34ea05950f1d4be8f9c3e02f5088fd29d4f001e","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                                  \"equal.\")"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    for sort_dir in sort_dirs:"},{"line_number":64,"context_line":"        if sort_dir not in [\u0027asc\u0027, \u0027desc\u0027]:"},{"line_number":65,"context_line":"            raise exc.ClientSideError(\"Unknown sort direction, must be \u0027desc\u0027 \""},{"line_number":66,"context_line":"                                      \"or \u0027asc\u0027\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_2e725eae","line":64,"in_reply_to":"3a50d1a3_ddc855ab","updated":"2015-07-24 09:27:27.000000000","message":"Make sense. I\u0027ll catch exceptions for db query, not only InvalidSortKey but aslo others.","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"be8ab73e57960326d35f36a183658ad53bd16ed9","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                                  \"equal.\")"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    for sort_dir in sort_dirs:"},{"line_number":64,"context_line":"        if sort_dir not in [\u0027asc\u0027, \u0027desc\u0027]:"},{"line_number":65,"context_line":"            raise exc.ClientSideError(\"Unknown sort direction, must be \u0027desc\u0027 \""},{"line_number":66,"context_line":"                                      \"or \u0027asc\u0027\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a50d1a3_7d1ca1c1","line":64,"in_reply_to":"3a50d1a3_ddc855ab","updated":"2015-07-24 07:26:59.000000000","message":"agree, so we need to catch the exception InvalidSortKey.","commit_id":"50aa1c4686be1edb70786c91e1e5029a7369b677"}]}
