)]}'
{"quantum/db/db_base_plugin_v2.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"7e55beb793646d40c3e672c703de841745afc2f0","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    def _setup_dict_functions(self):"},{"line_number":84,"context_line":"        # Gather methods for extending resource dicts from mixins in the MRO"},{"line_number":85,"context_line":"        # We use inspect rather than __mro__ so that it works also with old"},{"line_number":86,"context_line":"        # style classes (altough Quantum should enfore not having them)"},{"line_number":87,"context_line":"        self._dict_extend_functions \u003d {}"},{"line_number":88,"context_line":"        for cl in inspect.getmro(type(self)):"},{"line_number":89,"context_line":"            if hasattr(cl, \u0027_update_dict_extend_functions\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FrxY%3D","line":86,"updated":"2013-04-29 09:30:39.000000000","message":"typo: enforce","commit_id":"c14653cd17bf96729e01a6bbc894e08a22604dfc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":83,"context_line":"    def _setup_dict_functions(self):"},{"line_number":84,"context_line":"        # Gather methods for extending resource dicts from mixins in the MRO"},{"line_number":85,"context_line":"        # We use inspect rather than __mro__ so that it works also with old"},{"line_number":86,"context_line":"        # style classes (altough Quantum should enfore not having them)"},{"line_number":87,"context_line":"        self._dict_extend_functions \u003d {}"},{"line_number":88,"context_line":"        for cl in inspect.getmro(type(self)):"},{"line_number":89,"context_line":"            if hasattr(cl, \u0027_update_dict_extend_functions\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2Fq5I%3D","line":86,"in_reply_to":"AAAAOn%2F%2FrxY%3D","updated":"2013-04-29 19:22:59.000000000","message":"Done","commit_id":"c14653cd17bf96729e01a6bbc894e08a22604dfc"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"7e55beb793646d40c3e672c703de841745afc2f0","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        The data dict passed in input is copied so orignal data are not"},{"line_number":161,"context_line":"        altered by this routine."},{"line_number":162,"context_line":"        \"\"\""},{"line_number":163,"context_line":"        data_copy \u003d data.copy()"},{"line_number":164,"context_line":"        columns \u003d [c.name for c in model.__table__.columns]"},{"line_number":165,"context_line":"        return dict([(k, v) for (k, v) in"},{"line_number":166,"context_line":"                     data_copy.iteritems() if k in columns])"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2Frww%3D","line":163,"updated":"2013-04-29 09:30:39.000000000","message":"Am I missing something, but why this method would modify \u0027data \u0027 if it is not copied?","commit_id":"c14653cd17bf96729e01a6bbc894e08a22604dfc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":160,"context_line":"        The data dict passed in input is copied so orignal data are not"},{"line_number":161,"context_line":"        altered by this routine."},{"line_number":162,"context_line":"        \"\"\""},{"line_number":163,"context_line":"        data_copy \u003d data.copy()"},{"line_number":164,"context_line":"        columns \u003d [c.name for c in model.__table__.columns]"},{"line_number":165,"context_line":"        return dict([(k, v) for (k, v) in"},{"line_number":166,"context_line":"                     data_copy.iteritems() if k in columns])"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2Fq44%3D","line":163,"in_reply_to":"AAAAOn%2F%2Frww%3D","updated":"2013-04-29 19:22:59.000000000","message":"good point. I had originally some code which invoked pop.\nNow this line is not necessary anymore.","commit_id":"c14653cd17bf96729e01a6bbc894e08a22604dfc"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"7e55beb793646d40c3e672c703de841745afc2f0","unresolved":false,"context_lines":[{"line_number":1394,"context_line":"                        expiration\u003dself._default_allocation_expiration())"},{"line_number":1395,"context_line":"                    context.session.add(allocated)"},{"line_number":1396,"context_line":"        # Remove all attributes in p which are not in the port DB model"},{"line_number":1397,"context_line":"        # and then updated the port"},{"line_number":1398,"context_line":"        port.update(self._filter_non_model_attributes(p, models_v2.Port))"},{"line_number":1399,"context_line":""},{"line_number":1400,"context_line":"        return self._make_port_dict(port)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2Frwk%3D","line":1397,"updated":"2013-04-29 09:30:39.000000000","message":"typo: update","commit_id":"c14653cd17bf96729e01a6bbc894e08a22604dfc"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"unresolved":false,"context_lines":[{"line_number":83,"context_line":"    def _setup_dict_functions(self):"},{"line_number":84,"context_line":"        # Gather methods for extending resource dicts from mixins in the MRO"},{"line_number":85,"context_line":"        # We use inspect rather than __mro__ so that it works also with old"},{"line_number":86,"context_line":"        # style classes (altough Quantum should enfore not having them)"},{"line_number":87,"context_line":"        self._dict_extend_functions \u003d {}"},{"line_number":88,"context_line":"        for cl in inspect.getmro(type(self)):"},{"line_number":89,"context_line":"            if hasattr(cl, \u0027_update_dict_extend_functions\u0027):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Frto%3D","line":86,"updated":"2013-04-29 09:49:33.000000000","message":"typo: s/altough/although, s/enfore/enforce","commit_id":"a7ebd5b269009434c61c408b75fb64cd96ebdd5e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":83,"context_line":"    def _setup_dict_functions(self):"},{"line_number":84,"context_line":"        # Gather methods for extending resource dicts from mixins in the MRO"},{"line_number":85,"context_line":"        # We use inspect rather than __mro__ so that it works also with old"},{"line_number":86,"context_line":"        # style classes (altough Quantum should enfore not having them)"},{"line_number":87,"context_line":"        self._dict_extend_functions \u003d {}"},{"line_number":88,"context_line":"        for cl in inspect.getmro(type(self)):"},{"line_number":89,"context_line":"            if hasattr(cl, \u0027_update_dict_extend_functions\u0027):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Frfs%3D","line":86,"in_reply_to":"AAAAOn%2F%2Frto%3D","updated":"2013-04-29 13:39:42.000000000","message":"Done","commit_id":"a7ebd5b269009434c61c408b75fb64cd96ebdd5e"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"unresolved":false,"context_lines":[{"line_number":88,"context_line":"        for cl in inspect.getmro(type(self)):"},{"line_number":89,"context_line":"            if hasattr(cl, \u0027_update_dict_extend_functions\u0027):"},{"line_number":90,"context_line":"                cl._update_dict_extend_functions("},{"line_number":91,"context_line":"                    self, self._dict_extend_functions)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def _get_tenant_id_for_create(self, context, resource):"},{"line_number":94,"context_line":"        if context.is_admin and \u0027tenant_id\u0027 in resource:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Frt8%3D","line":91,"updated":"2013-04-29 09:49:33.000000000","message":"How about use a dict instead of \u0027_update_dict_extend_functions\u0027? \nThen we just need update the _dict_extend_functions at here\nplease refer the comment in file \u0027quantum/db/securitygroups_db.py:91\u0027","commit_id":"a7ebd5b269009434c61c408b75fb64cd96ebdd5e"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"7e55beb793646d40c3e672c703de841745afc2f0","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        The data dict passed in input is copied so orignal data are not"},{"line_number":161,"context_line":"        altered by this routine."},{"line_number":162,"context_line":"        \"\"\""},{"line_number":163,"context_line":"        data_copy \u003d data.copy()"},{"line_number":164,"context_line":"        columns \u003d [c.name for c in model.__table__.columns]"},{"line_number":165,"context_line":"        return dict([(k, v) for (k, v) in"},{"line_number":166,"context_line":"                     data_copy.iteritems() if k in columns])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fq6w%3D","line":163,"updated":"2013-04-29 19:11:29.000000000","message":"I\u0027ll repeat comment from the first version: \ndo we need data.copy here? It seems \u0027data\u0027 is not modified here","commit_id":"a7ebd5b269009434c61c408b75fb64cd96ebdd5e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":160,"context_line":"        The data dict passed in input is copied so orignal data are not"},{"line_number":161,"context_line":"        altered by this routine."},{"line_number":162,"context_line":"        \"\"\""},{"line_number":163,"context_line":"        data_copy \u003d data.copy()"},{"line_number":164,"context_line":"        columns \u003d [c.name for c in model.__table__.columns]"},{"line_number":165,"context_line":"        return dict([(k, v) for (k, v) in"},{"line_number":166,"context_line":"                     data_copy.iteritems() if k in columns])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fq5U%3D","line":163,"in_reply_to":"AAAAOn%2F%2Fq6w%3D","updated":"2013-04-29 19:21:38.000000000","message":"I did not see your comments at all. I pushed this patch before you posted your comments.\nI will look back at them.","commit_id":"a7ebd5b269009434c61c408b75fb64cd96ebdd5e"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"737e392dbd16c9506fec2bee91ad2ed109f0a636","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        model_hooks[name] \u003d {\u0027query\u0027: query_hook, \u0027filter\u0027: filter_hook,"},{"line_number":155,"context_line":"                             \u0027result_filters\u0027: result_filters}"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def _filter_non_model_attributes(self, data, model):"},{"line_number":158,"context_line":"        \"\"\"Remove all the attributes from data which are not columns of"},{"line_number":159,"context_line":"        the model passed as second parameter."},{"line_number":160,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FqJs%3D","line":157,"updated":"2013-04-30 09:02:35.000000000","message":"I think it would be more accurate to name this method _filter_non_model_columns() as relationship instances are attributes of model classes and you are filtering them out here.","commit_id":"3fff2377fb80bcf6954d036597f93be773468d8b"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":154,"context_line":"        model_hooks[name] \u003d {\u0027query\u0027: query_hook, \u0027filter\u0027: filter_hook,"},{"line_number":155,"context_line":"                             \u0027result_filters\u0027: result_filters}"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def _filter_non_model_attributes(self, data, model):"},{"line_number":158,"context_line":"        \"\"\"Remove all the attributes from data which are not columns of"},{"line_number":159,"context_line":"        the model passed as second parameter."},{"line_number":160,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2Fpxs%3D","line":157,"in_reply_to":"AAAAOn%2F%2FqJs%3D","updated":"2013-04-30 15:20:45.000000000","message":"Done","commit_id":"3fff2377fb80bcf6954d036597f93be773468d8b"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"737e392dbd16c9506fec2bee91ad2ed109f0a636","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"\"\""},{"line_number":161,"context_line":"        columns \u003d [c.name for c in model.__table__.columns]"},{"line_number":162,"context_line":"        return dict([(k, v) for (k, v) in"},{"line_number":163,"context_line":"                     data.iteritems() if k in columns])"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def _get_by_id(self, context, model, id):"},{"line_number":166,"context_line":"        query \u003d self._model_query(context, model)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FqJ4%3D","line":163,"updated":"2013-04-30 09:02:35.000000000","message":"just a minor nit: you can avoid creation of a list by omitting square brackets","commit_id":"3fff2377fb80bcf6954d036597f93be773468d8b"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"\"\""},{"line_number":161,"context_line":"        columns \u003d [c.name for c in model.__table__.columns]"},{"line_number":162,"context_line":"        return dict([(k, v) for (k, v) in"},{"line_number":163,"context_line":"                     data.iteritems() if k in columns])"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def _get_by_id(self, context, model, id):"},{"line_number":166,"context_line":"        query \u003d self._model_query(context, model)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2Fpxo%3D","line":163,"in_reply_to":"AAAAOn%2F%2FqJ4%3D","updated":"2013-04-30 15:20:45.000000000","message":"Done","commit_id":"3fff2377fb80bcf6954d036597f93be773468d8b"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":80,"context_line":"        db.configure_db()"},{"line_number":81,"context_line":"        self._setup_dict_functions()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _setup_dict_functions(self):"},{"line_number":84,"context_line":"        # Gather methods for extending resource dicts from mixins in the MRO"},{"line_number":85,"context_line":"        # We use inspect rather than __mro__ so that it works also with old"},{"line_number":86,"context_line":"        # style classes (although Quantum should enforce not having them)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2FlkM%3D","line":83,"updated":"2013-05-02 19:35:22.000000000","message":"I don\u0027t think we need to navigating python internals.  Why not use super here.\n\nmy_values \u003d {whatever}\nmy_values.update(super()…)\nreturn my_vlaues","commit_id":"e8ac9650bfe7b64cfb6ac25b5881afaa7e76b934"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":80,"context_line":"        db.configure_db()"},{"line_number":81,"context_line":"        self._setup_dict_functions()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _setup_dict_functions(self):"},{"line_number":84,"context_line":"        # Gather methods for extending resource dicts from mixins in the MRO"},{"line_number":85,"context_line":"        # We use inspect rather than __mro__ so that it works also with old"},{"line_number":86,"context_line":"        # style classes (although Quantum should enforce not having them)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2FkEg%3D","line":83,"in_reply_to":"AAAAOn%2F%2FkHA%3D","updated":"2013-05-03 18:11:28.000000000","message":"ah yes.. I have a few patches lined up too!\nWith static initializers, each mixin will declar its own dict_extend functions, adding them a dictionary which should be (statically) initialized in the base plugin","commit_id":"e8ac9650bfe7b64cfb6ac25b5881afaa7e76b934"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":80,"context_line":"        db.configure_db()"},{"line_number":81,"context_line":"        self._setup_dict_functions()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _setup_dict_functions(self):"},{"line_number":84,"context_line":"        # Gather methods for extending resource dicts from mixins in the MRO"},{"line_number":85,"context_line":"        # We use inspect rather than __mro__ so that it works also with old"},{"line_number":86,"context_line":"        # style classes (although Quantum should enforce not having them)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2FkHA%3D","line":83,"in_reply_to":"AAAAOn%2F%2FkKM%3D","updated":"2013-05-03 18:04:31.000000000","message":"What are the advantages of static initializers?\nBtw, I\u0027m waiting for this to be merged as I\u0027m fixing similar bug with extraroute mixin","commit_id":"e8ac9650bfe7b64cfb6ac25b5881afaa7e76b934"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":80,"context_line":"        db.configure_db()"},{"line_number":81,"context_line":"        self._setup_dict_functions()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _setup_dict_functions(self):"},{"line_number":84,"context_line":"        # Gather methods for extending resource dicts from mixins in the MRO"},{"line_number":85,"context_line":"        # We use inspect rather than __mro__ so that it works also with old"},{"line_number":86,"context_line":"        # style classes (although Quantum should enforce not having them)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2FkKM%3D","line":83,"in_reply_to":"AAAAOn%2F%2FlkM%3D","updated":"2013-05-03 17:21:19.000000000","message":"I totally agree with avoiding using internals or other forms of more or less black magic.\n\nI swear super was my first attempt!\nHowever that did not work well because I had to:\n- add a call to super in each implementation of _update_dict_extend_functions\n- before doing such call ensure the superclass actually defined the method (mixins inherit from object, so the last mixin will have object as the next element in mro).\n\nAnd frankly those are too many caveats for somebody who want to add a mixin which automatically extends a dict.\n\nI think I will revert to static inizializers which I initially discarded since they are ugly, but were also suggested as an alternative by Alex.","commit_id":"e8ac9650bfe7b64cfb6ac25b5881afaa7e76b934"}],"quantum/db/securitygroups_db.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"7e55beb793646d40c3e672c703de841745afc2f0","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from quantum.extensions import securitygroup as ext_sg"},{"line_number":28,"context_line":"from quantum.openstack.common import uuidutils"},{"line_number":29,"context_line":"from quantum.openstack.common import log"},{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class SecurityGroup(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FrwQ%3D","line":30,"updated":"2013-04-29 09:30:39.000000000","message":"blank line is missing?\nAlso, I guess pep8 is complaining about import order a line above.","commit_id":"c14653cd17bf96729e01a6bbc894e08a22604dfc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":27,"context_line":"from quantum.extensions import securitygroup as ext_sg"},{"line_number":28,"context_line":"from quantum.openstack.common import uuidutils"},{"line_number":29,"context_line":"from quantum.openstack.common import log"},{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class SecurityGroup(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2Fq40%3D","line":30,"in_reply_to":"AAAAOn%2F%2FrwQ%3D","updated":"2013-04-29 19:22:59.000000000","message":"This has already gone.","commit_id":"c14653cd17bf96729e01a6bbc894e08a22604dfc"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"7e55beb793646d40c3e672c703de841745afc2f0","unresolved":false,"context_lines":[{"line_number":398,"context_line":""},{"line_number":399,"context_line":"    def _extend_port_dict_security_group(self, port_res, port_db):"},{"line_number":400,"context_line":"        # If port_db is provided, security groups will be accessed via"},{"line_number":401,"context_line":"        # sqlalchemy models. Ad they\u0027re loaded together with ports this"},{"line_number":402,"context_line":"        # will not cause an extra query."},{"line_number":403,"context_line":"        security_group_ids \u003d [sec_group_mapping[\u0027security_group_id\u0027] for"},{"line_number":404,"context_line":"                              sec_group_mapping in port_db.security_groups]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2Frvc%3D","line":401,"updated":"2013-04-29 09:30:39.000000000","message":"typo: As","commit_id":"c14653cd17bf96729e01a6bbc894e08a22604dfc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":398,"context_line":""},{"line_number":399,"context_line":"    def _extend_port_dict_security_group(self, port_res, port_db):"},{"line_number":400,"context_line":"        # If port_db is provided, security groups will be accessed via"},{"line_number":401,"context_line":"        # sqlalchemy models. Ad they\u0027re loaded together with ports this"},{"line_number":402,"context_line":"        # will not cause an extra query."},{"line_number":403,"context_line":"        security_group_ids \u003d [sec_group_mapping[\u0027security_group_id\u0027] for"},{"line_number":404,"context_line":"                              sec_group_mapping in port_db.security_groups]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2Fq4w%3D","line":401,"in_reply_to":"AAAAOn%2F%2Frvc%3D","updated":"2013-04-29 19:22:59.000000000","message":"Done","commit_id":"c14653cd17bf96729e01a6bbc894e08a22604dfc"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"unresolved":false,"context_lines":[{"line_number":88,"context_line":"        backref\u003d\"securitygroupportbindings\","},{"line_number":89,"context_line":"        lazy\u003d\u0027joined\u0027, cascade\u003d\u0027delete\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def _update_dict_extend_functions(self, extend_func_dict):"},{"line_number":92,"context_line":"        port_extend_funcs \u003d extend_func_dict.get(attr.PORTS, [])"},{"line_number":93,"context_line":"        port_extend_funcs.append(self._extend_port_dict_security_group)"},{"line_number":94,"context_line":"        # Put back list in dict (this is necessary if the list was"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FruE%3D","line":91,"updated":"2013-04-29 09:49:33.000000000","message":"How about use a dict at here, as below:\n\nextend_functions \u003d {\n    attr.PORTS: [self._extend_port_dict_security_group]\n}\n\nThen we update \u0027self._dict_extend_functions\u0027  in _setup_dict_functions","commit_id":"a7ebd5b269009434c61c408b75fb64cd96ebdd5e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":88,"context_line":"        backref\u003d\"securitygroupportbindings\","},{"line_number":89,"context_line":"        lazy\u003d\u0027joined\u0027, cascade\u003d\u0027delete\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def _update_dict_extend_functions(self, extend_func_dict):"},{"line_number":92,"context_line":"        port_extend_funcs \u003d extend_func_dict.get(attr.PORTS, [])"},{"line_number":93,"context_line":"        port_extend_funcs.append(self._extend_port_dict_security_group)"},{"line_number":94,"context_line":"        # Put back list in dict (this is necessary if the list was"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Frfk%3D","line":91,"in_reply_to":"AAAAOn%2F%2FruE%3D","updated":"2013-04-29 13:39:42.000000000","message":"I am trying to avoid using class level attributes if possible.\n\nYour approach would work, but I\u0027d still have to iterate over the mro list, since I\u0027ll to fetch extend_functions for each mixin.\n\nThe way it works now seems a bit clunky because I could not do all the job in the __init__ for base plugin class.\nthis will be fixed in the future.","commit_id":"a7ebd5b269009434c61c408b75fb64cd96ebdd5e"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"737e392dbd16c9506fec2bee91ad2ed109f0a636","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    # Add a relationship to the Port model in order to instruct SQLAlchemy to"},{"line_number":87,"context_line":"    # eagerly load security group bindings"},{"line_number":88,"context_line":"    # NOTE: This is not a data model change, so no migration is required"},{"line_number":89,"context_line":"    setattr(models_v2.Port, \u0027security_groups\u0027, orm.relationship("},{"line_number":90,"context_line":"        SecurityGroupPortBinding,"},{"line_number":91,"context_line":"        backref\u003d\"securitygroupportbindings\","},{"line_number":92,"context_line":"        lazy\u003d\u0027joined\u0027, cascade\u003d\u0027delete\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FqJI%3D","line":89,"updated":"2013-04-30 09:02:35.000000000","message":"(IMHO) put this to SecurityGroupPortBinding class? use orm.backref() (http://docs.sqlalchemy.org/en/latest/orm/relationships.html#backref-arguments) and thus avoid using of setattr()?","commit_id":"3fff2377fb80bcf6954d036597f93be773468d8b"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":86,"context_line":"    # Add a relationship to the Port model in order to instruct SQLAlchemy to"},{"line_number":87,"context_line":"    # eagerly load security group bindings"},{"line_number":88,"context_line":"    # NOTE: This is not a data model change, so no migration is required"},{"line_number":89,"context_line":"    setattr(models_v2.Port, \u0027security_groups\u0027, orm.relationship("},{"line_number":90,"context_line":"        SecurityGroupPortBinding,"},{"line_number":91,"context_line":"        backref\u003d\"securitygroupportbindings\","},{"line_number":92,"context_line":"        lazy\u003d\u0027joined\u0027, cascade\u003d\u0027delete\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2Fpxg%3D","line":89,"in_reply_to":"AAAAOn%2F%2FqJI%3D","updated":"2013-04-30 15:20:45.000000000","message":"that\u0027s a good point. Hopefully backref would work as expected, fingers crossed.","commit_id":"3fff2377fb80bcf6954d036597f93be773468d8b"}]}
