)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"5998b0a9e1a81c0c8a83564de133f94b2c5f6c3c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Many object in Neutron have synthetic fields, that are fields that"},{"line_number":10,"context_line":"are filled using the data of a DB table different from the table"},{"line_number":11,"context_line":"used by the other fields. This patch make it possible to handle"},{"line_number":12,"context_line":"synthetic fields directly in NeutronDbObject so that objects"},{"line_number":13,"context_line":"can share this implementation."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5aef4532_6c02150d","line":11,"range":{"start_line":11,"start_character":24,"end_line":11,"end_character":25},"updated":"2016-03-08 15:00:38.000000000","message":"Maybe read better as: Many object in Neutron have synthetic fields. Synthetic fields are filled using data from fields of a different table.","commit_id":"208be60fc3d56057c316827c3499ca376541eb1a"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"5998b0a9e1a81c0c8a83564de133f94b2c5f6c3c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Many object in Neutron have synthetic fields, that are fields that"},{"line_number":10,"context_line":"are filled using the data of a DB table different from the table"},{"line_number":11,"context_line":"used by the other fields. This patch make it possible to handle"},{"line_number":12,"context_line":"synthetic fields directly in NeutronDbObject so that objects"},{"line_number":13,"context_line":"can share this implementation."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5aef4532_776302dd","line":11,"range":{"start_line":11,"start_character":37,"end_line":11,"end_character":41},"updated":"2016-03-08 15:00:38.000000000","message":"Nit: s/make/makes","commit_id":"208be60fc3d56057c316827c3499ca376541eb1a"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Handle synthetic fields in NeutronDbObject"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Many object in Neutron have synthetic fields. Synthethic fields"},{"line_number":10,"context_line":"are filled using the data from fields of a different table."},{"line_number":11,"context_line":"This patch makes it possible to handle synthetic fields directly"},{"line_number":12,"context_line":"in NeutronDbObject so that objects can share this implementation."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5aef4532_e7052014","line":9,"range":{"start_line":9,"start_character":5,"end_line":9,"end_character":11},"updated":"2016-03-10 14:05:30.000000000","message":"objects","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Handle synthetic fields in NeutronDbObject"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Many object in Neutron have synthetic fields. Synthethic fields"},{"line_number":10,"context_line":"are filled using the data from fields of a different table."},{"line_number":11,"context_line":"This patch makes it possible to handle synthetic fields directly"},{"line_number":12,"context_line":"in NeutronDbObject so that objects can share this implementation."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5aef4532_870a5c24","line":9,"range":{"start_line":9,"start_character":52,"end_line":9,"end_character":54},"updated":"2016-03-10 14:05:30.000000000","message":"t","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Handle synthetic fields in NeutronDbObject"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Many object in Neutron have synthetic fields. Synthethic fields"},{"line_number":10,"context_line":"are filled using the data from fields of a different table."},{"line_number":11,"context_line":"This patch makes it possible to handle synthetic fields directly"},{"line_number":12,"context_line":"in NeutronDbObject so that objects can share this implementation."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5aef4532_260b577f","line":9,"range":{"start_line":9,"start_character":5,"end_line":9,"end_character":11},"in_reply_to":"5aef4532_e7052014","updated":"2016-03-11 11:50:33.000000000","message":"Done","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"}],"neutron/objects/base.py":[{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"35d4643ca91870221069b08e6cf843a4b447f67d","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        db_obj \u003d db_api.get_object(context, cls.db_model,"},{"line_number":127,"context_line":"                                   **{cls.primary_key: id})"},{"line_number":128,"context_line":"        if db_obj:"},{"line_number":129,"context_line":"            obj \u003d cls(context, **db_obj)"},{"line_number":130,"context_line":"            for field in obj.fields:"},{"line_number":131,"context_line":"                if field not in obj.synthetic_fields and field in db_obj:"},{"line_number":132,"context_line":"                    obj[field] \u003d db_obj[field]"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_bc4aba25","line":129,"updated":"2016-02-25 10:28:28.000000000","message":"While working on Subnet OVO, I\u0027m getting error on creating the object saying that:\nIPAllocationPool (one of the synthetic field) should be the the of IPAllocationPool class not \"\" (empty)\nI could not fix this until I added _load_object field:\n@staticmethod\n    def _load_object(obj, db_obj):\n        for field in obj.fields:\n            if field not in obj.synthetic_fields and field in db_obj:\n                setattr(obj, field, db_obj[field])\n        obj.load_synthetic_fields()\n        obj.obj_reset_changes()\n        return obj\nPlease look at: \nhttps://review.openstack.org/#/c/264273/14/neutron/objects/base.py@174\n\nI think we can add the load_object in your patch.","commit_id":"e135027d49200037c40e5e5afd92ced4df9dfad0"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"35d4643ca91870221069b08e6cf843a4b447f67d","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    def get_objects(cls, context, **kwargs):"},{"line_number":139,"context_line":"        cls.validate_filters(**kwargs)"},{"line_number":140,"context_line":"        db_objs \u003d db_api.get_objects(context, cls.db_model, **kwargs)"},{"line_number":141,"context_line":"        objs \u003d [cls(context, **db_obj) for db_obj in db_objs]"},{"line_number":142,"context_line":"        for obj in objs:"},{"line_number":143,"context_line":"            obj.obj_reset_changes()"},{"line_number":144,"context_line":"        return objs"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_9cf536cd","line":141,"range":{"start_line":141,"start_character":16,"end_line":141,"end_character":37},"updated":"2016-02-25 10:28:28.000000000","message":"The same as line 129 - adding load_object and also we should load the synthetic field for get_objects method.","commit_id":"e135027d49200037c40e5e5afd92ced4df9dfad0"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"35d4643ca91870221069b08e6cf843a4b447f67d","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        return fields"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def load_synthetic_fields(self):"},{"line_number":166,"context_line":"        #TODO(rossella_s) Find a way to handle ObjectFields with"},{"line_number":167,"context_line":"        # subclasses\u003dTrue"},{"line_number":168,"context_line":"        for field in self.synthetic_fields:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_bc3e3a27","line":165,"updated":"2016-02-25 10:28:28.000000000","message":"Can we add in base class the obj_load_attr method using the load_sythentic fields like I have done in Subnet OVO:\nhttps://review.openstack.org/#/c/264273/14/neutron/objects/subnet.py@164\n\ndef obj_load_attr(self, attrname):\n        if attrname not in self.synthetic_fields:\n            raise n_exc.ObjectActionError(\n                action\u003d\u0027obj_load_attr\u0027,\n                reason\u003d_(\u0027unable to load %s\u0027) % attrname)\n\n        if not hasattr(self, attrname):\n            self.load_synthetic_field(attrname)","commit_id":"e135027d49200037c40e5e5afd92ced4df9dfad0"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"35d4643ca91870221069b08e6cf843a4b447f67d","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                break"},{"line_number":176,"context_line":"            objclass \u003d objclasses[0]"},{"line_number":177,"context_line":"            objs \u003d objclass.get_objects(self._context, **{"},{"line_number":178,"context_line":"                objclass.primary_key: getattr(self, self.primary_key)})"},{"line_number":179,"context_line":"            if objs:"},{"line_number":180,"context_line":"                if isinstance(self.fields[field], obj_fields.ObjectField):"},{"line_number":181,"context_line":"                    setattr(self, field, objs[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_fc572224","line":178,"updated":"2016-02-25 10:28:28.000000000","message":"I\u0027m not sure if this is working... for Subnet OVO I have to do:\nobjs \u003d objclass.get_objects(self._context, subnet_id\u003dgetattr(self, self.primary_key))\n\nThe similar thing is done in port OVO:\nobjs \u003d objclass.get_objects(self._context, port_id\u003dgetattr(self, self.primary_key))\n\nMy point is that the synthetic fields have the \"port_id\" or \"subnet_id\" foreign key defined, and this is the way of fetching them, by foreign key.\n\nIn line 178 you are using the primary key of synthetic field, which is not the same as foreign key which we want to join the two entities...\n\nPlease correct me if I\u0027m wrong.","commit_id":"e135027d49200037c40e5e5afd92ced4df9dfad0"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"2c3f8ce3d74104d6e9c19b5d40deee232907a5a0","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                break"},{"line_number":176,"context_line":"            objclass \u003d objclasses[0]"},{"line_number":177,"context_line":"            objs \u003d objclass.get_objects(self._context, **{"},{"line_number":178,"context_line":"                objclass.primary_key: getattr(self, self.primary_key)})"},{"line_number":179,"context_line":"            if objs:"},{"line_number":180,"context_line":"                if isinstance(self.fields[field], obj_fields.ObjectField):"},{"line_number":181,"context_line":"                    setattr(self, field, objs[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aed3d3a_2eccae34","line":178,"in_reply_to":"bae84128_fc572224","updated":"2016-02-26 10:10:41.000000000","message":"This patch needs to be updated, I didn\u0027t take care of composite keys here. Let\u0027s merge your patch about composite keys then we can move forward.","commit_id":"e135027d49200037c40e5e5afd92ced4df9dfad0"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"22b3e547bd1622c2f67c16d68777e92e1527c1c1","unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        db_obj \u003d obj_db_api.get_object(context, cls.db_model, **kwargs)"},{"line_number":156,"context_line":"        if db_obj:"},{"line_number":157,"context_line":"            obj \u003d cls(context, **db_obj)"},{"line_number":158,"context_line":"            for field in obj.fields:"},{"line_number":159,"context_line":"                if field not in obj.synthetic_fields and field in db_obj:"},{"line_number":160,"context_line":"                    obj[field] \u003d db_obj[field]"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_be050a7b","line":157,"updated":"2016-03-03 14:04:58.000000000","message":"If we are doing the loop lines 158-160, we do not want to pass the db_obj in constructor of object.\nThe line 157 should be: obj \u003d cls(context)\nand then the loop assigning the params from DB will make sense.\n\nI would make separate method loading the object, and reuse it in get_object and get_objects as well...\n\n@staticmethod\n    def _load_object(obj, db_obj):\n        for field in obj.fields:\n            if field not in obj.synthetic_fields and field in db_obj:\n                setattr(obj, field, db_obj[field])\n        obj.load_synthetic_fields()\n        obj.obj_reset_changes()\n        return obj","commit_id":"cfd38fcd6357abee119ac6bde502f067326f4576"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"22b3e547bd1622c2f67c16d68777e92e1527c1c1","unresolved":false,"context_lines":[{"line_number":157,"context_line":"            obj \u003d cls(context, **db_obj)"},{"line_number":158,"context_line":"            for field in obj.fields:"},{"line_number":159,"context_line":"                if field not in obj.synthetic_fields and field in db_obj:"},{"line_number":160,"context_line":"                    obj[field] \u003d db_obj[field]"},{"line_number":161,"context_line":"            obj.load_synthetic_db_fields()"},{"line_number":162,"context_line":"            obj.obj_reset_changes()"},{"line_number":163,"context_line":"            return obj"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_e384190c","line":160,"updated":"2016-03-03 14:04:58.000000000","message":"Can we use setattr(obj, field, db_obj[field]) here?","commit_id":"cfd38fcd6357abee119ac6bde502f067326f4576"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"22b3e547bd1622c2f67c16d68777e92e1527c1c1","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    def get_objects(cls, context, **kwargs):"},{"line_number":167,"context_line":"        cls.validate_filters(**kwargs)"},{"line_number":168,"context_line":"        db_objs \u003d obj_db_api.get_objects(context, cls.db_model, **kwargs)"},{"line_number":169,"context_line":"        objs \u003d [cls(context, **db_obj) for db_obj in db_objs]"},{"line_number":170,"context_line":"        for obj in objs:"},{"line_number":171,"context_line":"            obj.obj_reset_changes()"},{"line_number":172,"context_line":"        return objs"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    @classmethod"},{"line_number":175,"context_line":"    def is_accessible(cls, context, db_obj):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_be64ea21","line":172,"range":{"start_line":169,"start_character":8,"end_line":172,"end_character":19},"updated":"2016-03-03 14:04:58.000000000","message":"This can be rewritten into:\nreturn [cls._load_object(cls(context), (db_obj))\n                for db_obj in db_objs]","commit_id":"cfd38fcd6357abee119ac6bde502f067326f4576"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"7f67677e6ff19ac98e757e035dad6afef6d6f207","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.objects.db import api as obj_db_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class NeutronObjectUpdateForbidden(exceptions.NeutronException):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_88d792be","line":27,"updated":"2016-03-08 12:47:54.000000000","message":"I need to remove this, meh","commit_id":"208be60fc3d56057c316827c3499ca376541eb1a"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"5998b0a9e1a81c0c8a83564de133f94b2c5f6c3c","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.objects.db import api as obj_db_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class NeutronObjectUpdateForbidden(exceptions.NeutronException):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_578c067f","line":27,"in_reply_to":"5aef4532_88d792be","updated":"2016-03-08 15:00:38.000000000","message":"You are using LOG in the code?","commit_id":"208be60fc3d56057c316827c3499ca376541eb1a"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"56e36a3392f0c196ae60ee45de5e8501ef9bd1d8","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.objects.db import api as obj_db_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class NeutronObjectUpdateForbidden(exceptions.NeutronException):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_159b5673","line":27,"updated":"2016-03-09 14:41:51.000000000","message":"Still not removed?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.objects.db import api as obj_db_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class NeutronObjectUpdateForbidden(exceptions.NeutronException):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_66539f6d","line":27,"in_reply_to":"5aef4532_159b5673","updated":"2016-03-11 11:50:33.000000000","message":"It\u0027s actually used, see line 224","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        )"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"class NeutronSynthethicFieldMultipleForeignKeys(exceptions.NeutronException):"},{"line_number":59,"context_line":"    message \u003d _(\"Synthetic field %(fields)s shouldn\u0027t have more than one \""},{"line_number":60,"context_line":"                \"foreign key\")"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_6208de28","line":58,"range":{"start_line":58,"start_character":19,"end_line":58,"end_character":21},"updated":"2016-03-10 14:05:30.000000000","message":"t","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        )"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"class NeutronSynthethicFieldMultipleForeignKeys(exceptions.NeutronException):"},{"line_number":59,"context_line":"    message \u003d _(\"Synthetic field %(fields)s shouldn\u0027t have more than one \""},{"line_number":60,"context_line":"                \"foreign key\")"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_6601df39","line":58,"range":{"start_line":58,"start_character":19,"end_line":58,"end_character":21},"in_reply_to":"5aef4532_6208de28","updated":"2016-03-11 11:50:33.000000000","message":"Done","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"class NeutronSynthethicFieldMultipleForeignKeys(exceptions.NeutronException):"},{"line_number":59,"context_line":"    message \u003d _(\"Synthetic field %(fields)s shouldn\u0027t have more than one \""},{"line_number":60,"context_line":"                \"foreign key\")"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_a2166649","line":59,"range":{"start_line":59,"start_character":27,"end_line":59,"end_character":32},"updated":"2016-03-10 14:05:30.000000000","message":"fields?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"class NeutronSynthethicFieldMultipleForeignKeys(exceptions.NeutronException):"},{"line_number":59,"context_line":"    message \u003d _(\"Synthetic field %(fields)s shouldn\u0027t have more than one \""},{"line_number":60,"context_line":"                \"foreign key\")"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_46fe6339","line":59,"range":{"start_line":59,"start_character":27,"end_line":59,"end_character":32},"in_reply_to":"5aef4532_a2166649","updated":"2016-03-11 11:50:33.000000000","message":"Done","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        for field in self.synthetic_fields:"},{"line_number":85,"context_line":"            if field in dict_:"},{"line_number":86,"context_line":"                if isinstance(dict_[field], list):"},{"line_number":87,"context_line":"                    dict_[field] \u003d [obj.to_dict() for obj in dict_[field]]"},{"line_number":88,"context_line":"                else:"},{"line_number":89,"context_line":"                    dict_[field] \u003d ("},{"line_number":90,"context_line":"                        dict_[field].to_dict() if dict_[field] else None)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_626d7ecb","line":87,"updated":"2016-03-10 14:05:30.000000000","message":"Do we assume here that all synthetic fields contain other objects? Is it a reasonable assumption?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        for field in self.synthetic_fields:"},{"line_number":85,"context_line":"            if field in dict_:"},{"line_number":86,"context_line":"                if isinstance(dict_[field], list):"},{"line_number":87,"context_line":"                    dict_[field] \u003d [obj.to_dict() for obj in dict_[field]]"},{"line_number":88,"context_line":"                else:"},{"line_number":89,"context_line":"                    dict_[field] \u003d ("},{"line_number":90,"context_line":"                        dict_[field].to_dict() if dict_[field] else None)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_660b9f2c","line":87,"in_reply_to":"5aef4532_626d7ecb","updated":"2016-03-11 11:50:33.000000000","message":"here actually the assumption is that all have an implementation of the method to_dict :) joking, do you want me to add some check ?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        for field in self.synthetic_fields:"},{"line_number":85,"context_line":"            if field in dict_:"},{"line_number":86,"context_line":"                if isinstance(dict_[field], list):"},{"line_number":87,"context_line":"                    dict_[field] \u003d [obj.to_dict() for obj in dict_[field]]"},{"line_number":88,"context_line":"                else:"},{"line_number":89,"context_line":"                    dict_[field] \u003d ("},{"line_number":90,"context_line":"                        dict_[field].to_dict() if dict_[field] else None)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_633f1126","line":87,"in_reply_to":"5aef4532_660b9f2c","updated":"2016-03-11 14:52:51.000000000","message":"I made this more strict","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"56e36a3392f0c196ae60ee45de5e8501ef9bd1d8","unresolved":false,"context_lines":[{"line_number":132,"context_line":"    primary_keys \u003d [\u0027id\u0027]"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    # a dict to store the association between the foreign key and the"},{"line_number":135,"context_line":"    # corresponding key in the main table"},{"line_number":136,"context_line":"    foreign_keys \u003d {}"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    fields_no_update \u003d []"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_35c77265","line":135,"updated":"2016-03-09 14:41:51.000000000","message":"Can you provide an example for foreign_keys structure?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":132,"context_line":"    primary_keys \u003d [\u0027id\u0027]"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    # a dict to store the association between the foreign key and the"},{"line_number":135,"context_line":"    # corresponding key in the main table"},{"line_number":136,"context_line":"    foreign_keys \u003d {}"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    fields_no_update \u003d []"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_469303a4","line":135,"in_reply_to":"5aef4532_0dd94b57","updated":"2016-03-11 14:52:51.000000000","message":"Done","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":132,"context_line":"    primary_keys \u003d [\u0027id\u0027]"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    # a dict to store the association between the foreign key and the"},{"line_number":135,"context_line":"    # corresponding key in the main table"},{"line_number":136,"context_line":"    foreign_keys \u003d {}"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    fields_no_update \u003d []"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_0dd94b57","line":135,"in_reply_to":"5aef4532_35c77265","updated":"2016-03-10 14:05:30.000000000","message":"+ that would help readers and reviewers a lot","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"9dd47233adfbf3d08b1ee80d65614dc2b6af1a42","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    # a dict to store the association between the foreign key and the"},{"line_number":135,"context_line":"    # corresponding key in the main table"},{"line_number":136,"context_line":"    foreign_keys \u003d {}"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    fields_no_update \u003d []"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_31393cd8","line":136,"updated":"2016-03-09 16:47:42.000000000","message":"According to the line 232, the order of the foreign keys matter right?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    # a dict to store the association between the foreign key and the"},{"line_number":135,"context_line":"    # corresponding key in the main table"},{"line_number":136,"context_line":"    foreign_keys \u003d {}"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    fields_no_update \u003d []"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_4da7d30a","line":136,"in_reply_to":"5aef4532_31393cd8","updated":"2016-03-10 14:05:30.000000000","message":"It will if we allow multiple keys.","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    # a dict to store the association between the foreign key and the"},{"line_number":135,"context_line":"    # corresponding key in the main table"},{"line_number":136,"context_line":"    foreign_keys \u003d {}"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    fields_no_update \u003d []"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_090d8c37","line":136,"in_reply_to":"5aef4532_4da7d30a","updated":"2016-03-11 11:50:33.000000000","message":"correct, for now I don\u0027t see the need to allow multiple keys anyway :)","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    @classmethod"},{"line_number":150,"context_line":"    def _load_object(cls, context, db_obj):"},{"line_number":151,"context_line":"        obj \u003d cls(context)"},{"line_number":152,"context_line":"        for field in obj.fields:"},{"line_number":153,"context_line":"            if field not in obj.synthetic_fields and field in db_obj:"},{"line_number":154,"context_line":"                setattr(obj, field, db_obj[field])"},{"line_number":155,"context_line":"        obj.load_synthetic_db_fields()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_c270d242","line":152,"updated":"2016-03-10 14:05:30.000000000","message":"Lines 152-156 are identical to lines 141-147. Consider reusing the code (meaning, you will just call .from_db_object after creating a new object.","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    @classmethod"},{"line_number":150,"context_line":"    def _load_object(cls, context, db_obj):"},{"line_number":151,"context_line":"        obj \u003d cls(context)"},{"line_number":152,"context_line":"        for field in obj.fields:"},{"line_number":153,"context_line":"            if field not in obj.synthetic_fields and field in db_obj:"},{"line_number":154,"context_line":"                setattr(obj, field, db_obj[field])"},{"line_number":155,"context_line":"        obj.load_synthetic_db_fields()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_06ed7b8b","line":152,"in_reply_to":"5aef4532_c270d242","updated":"2016-03-11 14:52:51.000000000","message":"they are not exactly the same because from_db_object sets the fields for self, this method sets them for a db_obj. Not sure it\u0027s worth refactoring to re-use some line...what do you think?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    @classmethod"},{"line_number":150,"context_line":"    def _load_object(cls, context, db_obj):"},{"line_number":151,"context_line":"        obj \u003d cls(context)"},{"line_number":152,"context_line":"        for field in obj.fields:"},{"line_number":153,"context_line":"            if field not in obj.synthetic_fields and field in db_obj:"},{"line_number":154,"context_line":"                setattr(obj, field, db_obj[field])"},{"line_number":155,"context_line":"        obj.load_synthetic_db_fields()"},{"line_number":156,"context_line":"        obj.obj_reset_changes()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_82f7ead1","line":153,"range":{"start_line":152,"start_character":8,"end_line":153,"end_character":48},"updated":"2016-03-10 14:05:30.000000000","message":"We have the need to extract \u0027real\u0027 fields in multiple places. How about introducing a property that would calculate it for us?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    @classmethod"},{"line_number":150,"context_line":"    def _load_object(cls, context, db_obj):"},{"line_number":151,"context_line":"        obj \u003d cls(context)"},{"line_number":152,"context_line":"        for field in obj.fields:"},{"line_number":153,"context_line":"            if field not in obj.synthetic_fields and field in db_obj:"},{"line_number":154,"context_line":"                setattr(obj, field, db_obj[field])"},{"line_number":155,"context_line":"        obj.load_synthetic_db_fields()"},{"line_number":156,"context_line":"        obj.obj_reset_changes()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_795220df","line":153,"range":{"start_line":152,"start_character":8,"end_line":153,"end_character":48},"in_reply_to":"5aef4532_82f7ead1","updated":"2016-03-11 14:52:51.000000000","message":"Done","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def load_synthetic_db_fields(self):"},{"line_number":209,"context_line":"        \"\"\""},{"line_number":210,"context_line":"        This method loads the synthetic fields that are store in a different"},{"line_number":211,"context_line":"        table from the main object"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        This method doesn\u0027t take care of loading synthetic fields that aren\u0027t"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_e2acee8d","line":210,"range":{"start_line":210,"start_character":56,"end_line":210,"end_character":61},"updated":"2016-03-10 14:05:30.000000000","message":"stored","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def load_synthetic_db_fields(self):"},{"line_number":209,"context_line":"        \"\"\""},{"line_number":210,"context_line":"        This method loads the synthetic fields that are store in a different"},{"line_number":211,"context_line":"        table from the main object"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        This method doesn\u0027t take care of loading synthetic fields that aren\u0027t"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_09f74cf6","line":210,"range":{"start_line":210,"start_character":56,"end_line":210,"end_character":61},"in_reply_to":"5aef4532_e2acee8d","updated":"2016-03-11 11:50:33.000000000","message":"Done","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                objclasses \u003d obj_base.VersionedObjectRegistry.obj_classes("},{"line_number":222,"context_line":"                ).get(self.fields[field].objname)"},{"line_number":223,"context_line":"            except AttributeError:"},{"line_number":224,"context_line":"                LOG.debug(\"Synthetic field %s is not an ObjectField\", field)"},{"line_number":225,"context_line":"                continue"},{"line_number":226,"context_line":"            if not objclasses:"},{"line_number":227,"context_line":"                # NOTE(rossella_s) some synthetic fields are not handled by"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_221b7682","line":224,"updated":"2016-03-10 14:05:30.000000000","message":"Do we really want to pollute logs with that? Or do you think it indicates some issue?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                objclasses \u003d obj_base.VersionedObjectRegistry.obj_classes("},{"line_number":222,"context_line":"                ).get(self.fields[field].objname)"},{"line_number":223,"context_line":"            except AttributeError:"},{"line_number":224,"context_line":"                LOG.debug(\"Synthetic field %s is not an ObjectField\", field)"},{"line_number":225,"context_line":"                continue"},{"line_number":226,"context_line":"            if not objclasses:"},{"line_number":227,"context_line":"                # NOTE(rossella_s) some synthetic fields are not handled by"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_69c3708b","line":224,"in_reply_to":"5aef4532_221b7682","updated":"2016-03-11 11:50:33.000000000","message":"let\u0027s remove it","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                # NOTE(rossella_s) some synthetic fields are not handled by"},{"line_number":228,"context_line":"                # this method, for example the ones that have subclasses, see"},{"line_number":229,"context_line":"                # QosRule"},{"line_number":230,"context_line":"                break"},{"line_number":231,"context_line":"            objclass \u003d objclasses[0]"},{"line_number":232,"context_line":"            if len(objclass.foreign_keys.keys()) \u003e 1:"},{"line_number":233,"context_line":"                raise NeutronSynthethicFieldMultipleForeignKeys(field\u003dfield)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_c200d204","line":230,"updated":"2016-03-10 14:05:30.000000000","message":"continue maybe?..","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                # NOTE(rossella_s) some synthetic fields are not handled by"},{"line_number":228,"context_line":"                # this method, for example the ones that have subclasses, see"},{"line_number":229,"context_line":"                # QosRule"},{"line_number":230,"context_line":"                break"},{"line_number":231,"context_line":"            objclass \u003d objclasses[0]"},{"line_number":232,"context_line":"            if len(objclass.foreign_keys.keys()) \u003e 1:"},{"line_number":233,"context_line":"                raise NeutronSynthethicFieldMultipleForeignKeys(field\u003dfield)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_a95458ca","line":230,"in_reply_to":"5aef4532_c200d204","updated":"2016-03-11 11:50:33.000000000","message":"doh!","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"56e36a3392f0c196ae60ee45de5e8501ef9bd1d8","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                # QosRule"},{"line_number":230,"context_line":"                break"},{"line_number":231,"context_line":"            objclass \u003d objclasses[0]"},{"line_number":232,"context_line":"            if len(objclass.foreign_keys.keys()) \u003e 1:"},{"line_number":233,"context_line":"                raise NeutronSynthethicFieldMultipleForeignKeys(field\u003dfield)"},{"line_number":234,"context_line":"            objs \u003d objclass.get_objects("},{"line_number":235,"context_line":"                self._context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_15ffd6aa","line":232,"updated":"2016-03-09 14:41:51.000000000","message":"do we need this if?\nI guess we should model foreign keys to have direct representation in other tables.\nFor example:\n\nforeign_keys \u003d {\n  \u0027synthetic_field\u0027: {\u0027id_in_current_ovo\u0027, \u0027id_in_synthetic_field_table\u0027},\n  \u0027route\u0027: {\u0027id\u0027: \u0027subnet_id\u0027},\n  \u0027ipaddress\u0027: {\u0027tenant_id\u0027: \u0027main_tenant_id\u0027}\n}\n\nThen get_objects can look like:\nobjclass.get_objects(\n    self._context,\n    **{objclass.foreign_keys[field].values()[0]: getattr(\n    self, objclass.foreign_keys[field].keys()[0])})\n\nDoes it make any sense?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                # QosRule"},{"line_number":230,"context_line":"                break"},{"line_number":231,"context_line":"            objclass \u003d objclasses[0]"},{"line_number":232,"context_line":"            if len(objclass.foreign_keys.keys()) \u003e 1:"},{"line_number":233,"context_line":"                raise NeutronSynthethicFieldMultipleForeignKeys(field\u003dfield)"},{"line_number":234,"context_line":"            objs \u003d objclass.get_objects("},{"line_number":235,"context_line":"                self._context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_49caf46f","line":232,"in_reply_to":"5aef4532_0443f3b2","updated":"2016-03-11 11:50:33.000000000","message":"I think we can implement multiple foreign keys when needed. Having multiple foreign keys means that we need to fetch data from multiple tables, not so easy to handle. Do you have an use case for that?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"de55a0b1a875bfef01e1a299eca3f12566e998bb","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                # QosRule"},{"line_number":230,"context_line":"                break"},{"line_number":231,"context_line":"            objclass \u003d objclasses[0]"},{"line_number":232,"context_line":"            if len(objclass.foreign_keys.keys()) \u003e 1:"},{"line_number":233,"context_line":"                raise NeutronSynthethicFieldMultipleForeignKeys(field\u003dfield)"},{"line_number":234,"context_line":"            objs \u003d objclass.get_objects("},{"line_number":235,"context_line":"                self._context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_0443f3b2","line":232,"in_reply_to":"5aef4532_15ffd6aa","updated":"2016-03-10 09:31:54.000000000","message":"Ok, I have misunderstood the foreign key structure in the beginning, but I still vote for many foreign keys option.","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"03c32d7e5a222fc3f8c0357daf6a29107b00a236","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                # QosRule"},{"line_number":230,"context_line":"                break"},{"line_number":231,"context_line":"            objclass \u003d objclasses[0]"},{"line_number":232,"context_line":"            if len(objclass.foreign_keys.keys()) \u003e 1:"},{"line_number":233,"context_line":"                raise NeutronSynthethicFieldMultipleForeignKeys(field\u003dfield)"},{"line_number":234,"context_line":"            objs \u003d objclass.get_objects("},{"line_number":235,"context_line":"                self._context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_a8a42257","line":232,"in_reply_to":"5aef4532_49caf46f","updated":"2016-03-13 22:16:53.000000000","message":"forget my last comment, don\u0027t know what I was thinking. We need a better way to represent the foreign keys...a dict is pretty brittle in case of multiple foreign keys","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                raise NeutronSynthethicFieldMultipleForeignKeys(field\u003dfield)"},{"line_number":234,"context_line":"            objs \u003d objclass.get_objects("},{"line_number":235,"context_line":"                self._context,"},{"line_number":236,"context_line":"                **{objclass.foreign_keys.keys()[0]: getattr("},{"line_number":237,"context_line":"                    self, objclass.foreign_keys.values()[0])})"},{"line_number":238,"context_line":"            if objs:"},{"line_number":239,"context_line":"                if isinstance(self.fields[field], obj_fields.ObjectField):"},{"line_number":240,"context_line":"                    setattr(self, field, objs[0])"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_cd4f6332","line":237,"range":{"start_line":236,"start_character":16,"end_line":237,"end_character":62},"updated":"2016-03-10 14:05:30.000000000","message":":\n    {k: getattr(self, v)\n     for k, v in objclass.foreign_keys.items()}","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                raise NeutronSynthethicFieldMultipleForeignKeys(field\u003dfield)"},{"line_number":234,"context_line":"            objs \u003d objclass.get_objects("},{"line_number":235,"context_line":"                self._context,"},{"line_number":236,"context_line":"                **{objclass.foreign_keys.keys()[0]: getattr("},{"line_number":237,"context_line":"                    self, objclass.foreign_keys.values()[0])})"},{"line_number":238,"context_line":"            if objs:"},{"line_number":239,"context_line":"                if isinstance(self.fields[field], obj_fields.ObjectField):"},{"line_number":240,"context_line":"                    setattr(self, field, objs[0])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_a358f957","line":237,"range":{"start_line":236,"start_character":16,"end_line":237,"end_character":62},"in_reply_to":"5aef4532_cd4f6332","updated":"2016-03-11 14:52:51.000000000","message":"Done","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                **{objclass.foreign_keys.keys()[0]: getattr("},{"line_number":237,"context_line":"                    self, objclass.foreign_keys.values()[0])})"},{"line_number":238,"context_line":"            if objs:"},{"line_number":239,"context_line":"                if isinstance(self.fields[field], obj_fields.ObjectField):"},{"line_number":240,"context_line":"                    setattr(self, field, objs[0])"},{"line_number":241,"context_line":"                else:"},{"line_number":242,"context_line":"                    setattr(self, field, objs)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_6db3af0a","line":239,"updated":"2016-03-10 14:05:30.000000000","message":"If we expect just one result here, shouldn\u0027t we use get_object instead of get_objects?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a60fd504263083ae82b537c2918f5dfe6c76a89e","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                **{objclass.foreign_keys.keys()[0]: getattr("},{"line_number":237,"context_line":"                    self, objclass.foreign_keys.values()[0])})"},{"line_number":238,"context_line":"            if objs:"},{"line_number":239,"context_line":"                if isinstance(self.fields[field], obj_fields.ObjectField):"},{"line_number":240,"context_line":"                    setattr(self, field, objs[0])"},{"line_number":241,"context_line":"                else:"},{"line_number":242,"context_line":"                    setattr(self, field, objs)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_a2e11ad3","line":239,"in_reply_to":"5aef4532_6db3af0a","updated":"2016-03-11 11:50:33.000000000","message":"we might have multiple results too, see line 242 or are you suggesting that I should re-organize this code a bit?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":241,"context_line":"                else:"},{"line_number":242,"context_line":"                    setattr(self, field, objs)"},{"line_number":243,"context_line":"            else:"},{"line_number":244,"context_line":"                setattr(self, field, None)"},{"line_number":245,"context_line":"            self.obj_reset_changes([field])"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def create(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_4dad139a","line":244,"updated":"2016-03-10 14:05:30.000000000","message":"And what if the field is list? Shouldn\u0027t we set it to [] then?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":241,"context_line":"                else:"},{"line_number":242,"context_line":"                    setattr(self, field, objs)"},{"line_number":243,"context_line":"            else:"},{"line_number":244,"context_line":"                setattr(self, field, None)"},{"line_number":245,"context_line":"            self.obj_reset_changes([field])"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def create(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_59e76412","line":244,"in_reply_to":"5aef4532_4dad139a","updated":"2016-03-11 14:52:51.000000000","message":"you are right","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b2473bf51844bfaf903120cfd19cd623d0abb5ce","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.obj_set_defaults()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def to_dict(self):"},{"line_number":81,"context_line":"        dict_ \u003d dict(self.items())"},{"line_number":82,"context_line":"        for field in self.synthetic_fields:"},{"line_number":83,"context_line":"            if field in dict_:"},{"line_number":84,"context_line":"                if isinstance(dict_[field], obj_fields.ListOfObjectsField):"},{"line_number":85,"context_line":"                    dict_[field] \u003d [obj.to_dict() for obj in dict_[field]]"},{"line_number":86,"context_line":"                elif isinstance(dict_[field], obj_fields.ObjectField):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_0e5c6e24","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":30},"updated":"2016-03-15 15:31:08.000000000","message":"Suggestion: Would it make sense to encapsulate all these lines in a generator over synthetic_fields? It would simplify access to the field you\u0027re currently handling. Something like:\n\n\n def synthetic_fields_items(self):\n     for field in self.synthetic_fields:\n         if field in self.fields():\n             yield field, self.fields[field]\n\n\n def to_dict(self):\n     dict_ \u003d dict(self.items())\n     for field, value in self.synthetic_fields_items():\n         if isinstance(value, obj_fields.ListOfObjectsField):\n             dict_[field] \u003d [obj.to_dict() for obj in value]\n         elif isinstance(value, obj_fields.ObjectsField):\n             dict_[field] \u003d value.to_dict() if value else None)\n     return dict_","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b58304db591878dd21868a382ec03b77d6798212","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.obj_set_defaults()"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def to_dict(self):"},{"line_number":81,"context_line":"        dict_ \u003d dict(self.items())"},{"line_number":82,"context_line":"        for field in self.synthetic_fields:"},{"line_number":83,"context_line":"            if field in dict_:"},{"line_number":84,"context_line":"                if isinstance(dict_[field], obj_fields.ListOfObjectsField):"},{"line_number":85,"context_line":"                    dict_[field] \u003d [obj.to_dict() for obj in dict_[field]]"},{"line_number":86,"context_line":"                elif isinstance(dict_[field], obj_fields.ObjectField):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_6dd98183","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":30},"in_reply_to":"1af94dfe_0e5c6e24","updated":"2016-03-16 13:12:38.000000000","message":"Done","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b2473bf51844bfaf903120cfd19cd623d0abb5ce","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        return result"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    @classmethod"},{"line_number":205,"context_line":"    def _load_object(cls, context, db_obj):"},{"line_number":206,"context_line":"        obj \u003d cls(context, **cls.modify_fields_from_db(db_obj))"},{"line_number":207,"context_line":"        for field in obj.fields:"},{"line_number":208,"context_line":"            if not cls.is_synthetic(field) and field in db_obj:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_4e79562f","line":205,"range":{"start_line":205,"start_character":7,"end_line":205,"end_character":20},"updated":"2016-03-15 15:31:08.000000000","message":"nit: Maybe _create_object() ? Word \"load\" suggests that data are fetched from somewhere.","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b58304db591878dd21868a382ec03b77d6798212","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        return result"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    @classmethod"},{"line_number":205,"context_line":"    def _load_object(cls, context, db_obj):"},{"line_number":206,"context_line":"        obj \u003d cls(context, **cls.modify_fields_from_db(db_obj))"},{"line_number":207,"context_line":"        for field in obj.fields:"},{"line_number":208,"context_line":"            if not cls.is_synthetic(field) and field in db_obj:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_8dc5ed8f","line":205,"range":{"start_line":205,"start_character":7,"end_line":205,"end_character":20},"in_reply_to":"1af94dfe_4e79562f","updated":"2016-03-16 13:12:38.000000000","message":"Done","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"f4e59ad9d2566fe9548abfca4aace4d028677f6e","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    @classmethod"},{"line_number":205,"context_line":"    def _load_object(cls, context, db_obj):"},{"line_number":206,"context_line":"        obj \u003d cls(context, **cls.modify_fields_from_db(db_obj))"},{"line_number":207,"context_line":"        for field in obj.fields:"},{"line_number":208,"context_line":"            if not cls.is_synthetic(field) and field in db_obj:"},{"line_number":209,"context_line":"                setattr(obj, field, db_obj[field])"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_33ab938b","line":206,"updated":"2016-03-15 15:31:48.000000000","message":"you don\u0027t have to pass the fields in constructor, because you are setting the values in line 207-209.\nThis line should be:\nobj \u003d cls(context)","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b2473bf51844bfaf903120cfd19cd623d0abb5ce","unresolved":false,"context_lines":[{"line_number":204,"context_line":"    @classmethod"},{"line_number":205,"context_line":"    def _load_object(cls, context, db_obj):"},{"line_number":206,"context_line":"        obj \u003d cls(context, **cls.modify_fields_from_db(db_obj))"},{"line_number":207,"context_line":"        for field in obj.fields:"},{"line_number":208,"context_line":"            if not cls.is_synthetic(field) and field in db_obj:"},{"line_number":209,"context_line":"                setattr(obj, field, db_obj[field])"},{"line_number":210,"context_line":"        obj.load_synthetic_db_fields()"},{"line_number":211,"context_line":"        obj.obj_reset_changes()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_ae20daf8","line":208,"range":{"start_line":207,"start_character":0,"end_line":208,"end_character":63},"updated":"2016-03-15 15:31:08.000000000","message":"I think this part of the code is important for standard attributes part. \"field in db_obj\" won\u0027t return True for the referenced attributes so I think we must use hasattr instead\n\n if not cls.is_synthetic(field) and hasattr(db_obj, field):","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b58304db591878dd21868a382ec03b77d6798212","unresolved":false,"context_lines":[{"line_number":204,"context_line":"    @classmethod"},{"line_number":205,"context_line":"    def _load_object(cls, context, db_obj):"},{"line_number":206,"context_line":"        obj \u003d cls(context, **cls.modify_fields_from_db(db_obj))"},{"line_number":207,"context_line":"        for field in obj.fields:"},{"line_number":208,"context_line":"            if not cls.is_synthetic(field) and field in db_obj:"},{"line_number":209,"context_line":"                setattr(obj, field, db_obj[field])"},{"line_number":210,"context_line":"        obj.load_synthetic_db_fields()"},{"line_number":211,"context_line":"        obj.obj_reset_changes()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_2d5c99ec","line":208,"range":{"start_line":207,"start_character":0,"end_line":208,"end_character":63},"in_reply_to":"1af94dfe_ae20daf8","updated":"2016-03-16 13:12:38.000000000","message":"Done","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b2473bf51844bfaf903120cfd19cd623d0abb5ce","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":230,"context_line":"            db_obj \u003d obj_db_api.get_object(context, cls.db_model, **kwargs)"},{"line_number":231,"context_line":"            if db_obj:"},{"line_number":232,"context_line":"                return cls._load_object(context, db_obj)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    @classmethod"},{"line_number":235,"context_line":"    def get_objects(cls, context, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_ce64464b","line":232,"range":{"start_line":231,"start_character":0,"end_line":232,"end_character":56},"updated":"2016-03-15 15:31:08.000000000","message":"Are we good to leave transaction for these lines?","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b58304db591878dd21868a382ec03b77d6798212","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":230,"context_line":"            db_obj \u003d obj_db_api.get_object(context, cls.db_model, **kwargs)"},{"line_number":231,"context_line":"            if db_obj:"},{"line_number":232,"context_line":"                return cls._load_object(context, db_obj)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    @classmethod"},{"line_number":235,"context_line":"    def get_objects(cls, context, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_ed08f1db","line":232,"range":{"start_line":231,"start_character":0,"end_line":232,"end_character":56},"in_reply_to":"1af94dfe_ce64464b","updated":"2016-03-16 13:12:38.000000000","message":"Yes, since _load_object triggers fetches for synthetic fields.","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b2473bf51844bfaf903120cfd19cd623d0abb5ce","unresolved":false,"context_lines":[{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def load_synthetic_db_fields(self):"},{"line_number":266,"context_line":"        \"\"\""},{"line_number":267,"context_line":"        This method loads the synthetic fields that are stored in a different"},{"line_number":268,"context_line":"        table from the main object"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"        This method doesn\u0027t take care of loading synthetic fields that aren\u0027t"},{"line_number":271,"context_line":"        stored in the DB, e.g. \u0027shared\u0027 in rbac policy"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_09b588cc","line":268,"range":{"start_line":267,"start_character":0,"end_line":268,"end_character":34},"updated":"2016-03-15 15:31:08.000000000","message":"Super nit :) : As per pep257 the doc string should be more like:\n\nLoad the synthetic fields that are stored in a different ...","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b58304db591878dd21868a382ec03b77d6798212","unresolved":false,"context_lines":[{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def load_synthetic_db_fields(self):"},{"line_number":266,"context_line":"        \"\"\""},{"line_number":267,"context_line":"        This method loads the synthetic fields that are stored in a different"},{"line_number":268,"context_line":"        table from the main object"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"        This method doesn\u0027t take care of loading synthetic fields that aren\u0027t"},{"line_number":271,"context_line":"        stored in the DB, e.g. \u0027shared\u0027 in rbac policy"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_6dca2170","line":268,"range":{"start_line":267,"start_character":0,"end_line":268,"end_character":34},"in_reply_to":"1af94dfe_09b588cc","updated":"2016-03-16 13:12:38.000000000","message":"Done","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b2473bf51844bfaf903120cfd19cd623d0abb5ce","unresolved":false,"context_lines":[{"line_number":278,"context_line":"                objclasses \u003d obj_base.VersionedObjectRegistry.obj_classes("},{"line_number":279,"context_line":"                ).get(self.fields[field].objname)"},{"line_number":280,"context_line":"            except AttributeError:"},{"line_number":281,"context_line":"                # NOTE(rossella_s) this is probably because this field is not"},{"line_number":282,"context_line":"                # an ObjectField"},{"line_number":283,"context_line":"                continue"},{"line_number":284,"context_line":"            if not objclasses:"},{"line_number":285,"context_line":"                # NOTE(rossella_s) some synthetic fields are not handled by"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_ae58da57","line":282,"range":{"start_line":281,"start_character":0,"end_line":282,"end_character":32},"updated":"2016-03-15 15:31:08.000000000","message":"Aren\u0027t we supposed to use ObjectFields only? That would mean this is an error in the object code, right? If so, we should propagate it instead of silently skipping.","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b58304db591878dd21868a382ec03b77d6798212","unresolved":false,"context_lines":[{"line_number":278,"context_line":"                objclasses \u003d obj_base.VersionedObjectRegistry.obj_classes("},{"line_number":279,"context_line":"                ).get(self.fields[field].objname)"},{"line_number":280,"context_line":"            except AttributeError:"},{"line_number":281,"context_line":"                # NOTE(rossella_s) this is probably because this field is not"},{"line_number":282,"context_line":"                # an ObjectField"},{"line_number":283,"context_line":"                continue"},{"line_number":284,"context_line":"            if not objclasses:"},{"line_number":285,"context_line":"                # NOTE(rossella_s) some synthetic fields are not handled by"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_adc0a92b","line":282,"range":{"start_line":281,"start_character":0,"end_line":282,"end_character":32},"in_reply_to":"1af94dfe_ae58da57","updated":"2016-03-16 13:12:38.000000000","message":"Done","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b2473bf51844bfaf903120cfd19cd623d0abb5ce","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                raise NeutronSyntheticFieldMultipleForeignKeys(field\u003dfield)"},{"line_number":292,"context_line":"            objs \u003d objclass.get_objects("},{"line_number":293,"context_line":"                self._context, **{"},{"line_number":294,"context_line":"                    k: getattr("},{"line_number":295,"context_line":"                        self, v) for k, v in objclass.foreign_keys.items()})"},{"line_number":296,"context_line":"            if isinstance(self.fields[field], obj_fields.ObjectField):"},{"line_number":297,"context_line":"                setattr(self, field, objs[0] if objs else None)"},{"line_number":298,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_69724c7e","line":295,"range":{"start_line":294,"start_character":0,"end_line":295,"end_character":76},"updated":"2016-03-15 15:31:08.000000000","message":"Do we need a comprehension here since we\u0027re now sure there are either one or none foreign_key?","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b58304db591878dd21868a382ec03b77d6798212","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                raise NeutronSyntheticFieldMultipleForeignKeys(field\u003dfield)"},{"line_number":292,"context_line":"            objs \u003d objclass.get_objects("},{"line_number":293,"context_line":"                self._context, **{"},{"line_number":294,"context_line":"                    k: getattr("},{"line_number":295,"context_line":"                        self, v) for k, v in objclass.foreign_keys.items()})"},{"line_number":296,"context_line":"            if isinstance(self.fields[field], obj_fields.ObjectField):"},{"line_number":297,"context_line":"                setattr(self, field, objs[0] if objs else None)"},{"line_number":298,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_ad4a69aa","line":295,"range":{"start_line":294,"start_character":0,"end_line":295,"end_character":76},"in_reply_to":"1af94dfe_69724c7e","updated":"2016-03-16 13:12:38.000000000","message":"I don\u0027t think that requires a change. It seems like the code as-is is cleaner than what would be an alternative (where you would need to handle the case of an empty foreign_key list.","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe1214e97d4ed86e0167a59a0e1957755c56b25","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    # dict with name mapping: {\u0027field_name_in_object\u0027: \u0027field_name_in_db\u0027}"},{"line_number":167,"context_line":"    fields_need_translation \u003d {}"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def from_db_object(self, *objs):"},{"line_number":170,"context_line":"        db_objs \u003d [self.modify_fields_from_db(db_obj) for db_obj in objs]"},{"line_number":171,"context_line":"        for field in self.fields:"},{"line_number":172,"context_line":"            for db_obj in db_objs:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1af94dfe_7937a3b0","line":169,"updated":"2016-03-15 22:05:44.000000000","message":"(No action required) it\u0027s weird we allow multiple objects here. We still ignore all of them except the first one (see break in line 175). I guess we may want to clean that up later.","commit_id":"a1228133824039e3a9a9c424d00b2d5bd62b9b17"}],"neutron/objects/qos/policy.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"7f67677e6ff19ac98e757e035dad6afef6d6f207","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                not cls.is_accessible(context, policy_obj)):"},{"line_number":100,"context_line":"                return"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"            policy_obj.reload_rules()"},{"line_number":103,"context_line":"            return policy_obj"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_08670226","line":102,"updated":"2016-03-08 12:47:54.000000000","message":"I need to check if we still need to reload the rules","commit_id":"208be60fc3d56057c316827c3499ca376541eb1a"}],"neutron/tests/unit/objects/test_base.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    fields \u003d {"},{"line_number":109,"context_line":"        \u0027weird_key\u0027: obj_fields.UUIDField(),"},{"line_number":110,"context_line":"        \u0027field1\u0027: obj_fields.StringField(),"},{"line_number":111,"context_line":"        \u0027obj_field\u0027: obj_fields.ListOfObjectsField("},{"line_number":112,"context_line":"            \u0027FakeWeirdKeySmallNeutronObject\u0027)"},{"line_number":113,"context_line":"    }"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_323d838f","line":111,"updated":"2016-03-10 14:05:30.000000000","message":"Why do we need those changes here? Don\u0027t we plan to support synthetic fields that are not objects/iterables of objects?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    fields \u003d {"},{"line_number":109,"context_line":"        \u0027weird_key\u0027: obj_fields.UUIDField(),"},{"line_number":110,"context_line":"        \u0027field1\u0027: obj_fields.StringField(),"},{"line_number":111,"context_line":"        \u0027obj_field\u0027: obj_fields.ListOfObjectsField("},{"line_number":112,"context_line":"            \u0027FakeWeirdKeySmallNeutronObject\u0027)"},{"line_number":113,"context_line":"    }"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_9c039ab8","line":111,"in_reply_to":"5aef4532_323d838f","updated":"2016-03-11 14:52:51.000000000","message":"Yes we do. These changes were not needed, I\u0027ve thought I wanted to test the synthetic object fields also with non standard primary keys, modified it","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        self.valid_field_filter \u003d {valid_field: self.db_obj[valid_field]}"},{"line_number":185,"context_line":"        # NOTE(rossella_s): we mock the registry so we have more control on the"},{"line_number":186,"context_line":"        # classes taken into consideration when calculating the"},{"line_number":187,"context_line":"        # synthethic_fields"},{"line_number":188,"context_line":"        p_registry \u003d mock.patch("},{"line_number":189,"context_line":"            \u0027oslo_versionedobjects.base.VersionedObjectRegistry.obj_classes\u0027,"},{"line_number":190,"context_line":"            return_value\u003d{"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_d2fc1fba","line":187,"range":{"start_line":187,"start_character":16,"end_line":187,"end_character":18},"updated":"2016-03-10 14:05:30.000000000","message":"t","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        self.valid_field_filter \u003d {valid_field: self.db_obj[valid_field]}"},{"line_number":185,"context_line":"        # NOTE(rossella_s): we mock the registry so we have more control on the"},{"line_number":186,"context_line":"        # classes taken into consideration when calculating the"},{"line_number":187,"context_line":"        # synthethic_fields"},{"line_number":188,"context_line":"        p_registry \u003d mock.patch("},{"line_number":189,"context_line":"            \u0027oslo_versionedobjects.base.VersionedObjectRegistry.obj_classes\u0027,"},{"line_number":190,"context_line":"            return_value\u003d{"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_596da431","line":187,"range":{"start_line":187,"start_character":16,"end_line":187,"end_character":18},"in_reply_to":"5aef4532_d2fc1fba","updated":"2016-03-11 14:52:51.000000000","message":"at least I am consistent with this mistake","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # NOTE(rossella_s): we mock the registry so we have more control on the"},{"line_number":186,"context_line":"        # classes taken into consideration when calculating the"},{"line_number":187,"context_line":"        # synthethic_fields"},{"line_number":188,"context_line":"        p_registry \u003d mock.patch("},{"line_number":189,"context_line":"            \u0027oslo_versionedobjects.base.VersionedObjectRegistry.obj_classes\u0027,"},{"line_number":190,"context_line":"            return_value\u003d{"},{"line_number":191,"context_line":"                \u0027FakeSmallNeutronObject\u0027: [FakeSmallNeutronObject],"},{"line_number":192,"context_line":"                \u0027FakeWeirdKeySmallNeutronObject\u0027: ["},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"                     FakeWeirdKeySmallNeutronObject]})"},{"line_number":195,"context_line":"        p_registry.start()"},{"line_number":196,"context_line":"        synthetic_obj_fields \u003d self.get_random_fields(FakeSmallNeutronObject)"},{"line_number":197,"context_line":"        self.model_map \u003d {"},{"line_number":198,"context_line":"            self._test_class.db_model: self.db_objs,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_b2e5130a","line":195,"range":{"start_line":188,"start_character":8,"end_line":195,"end_character":26},"updated":"2016-03-10 14:05:30.000000000","message":"Hm. Isn\u0027t there a fixture to influence the objects registered?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b8df10031b001e116eb6e2bcc728c7bf0b0c65f2","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # NOTE(rossella_s): we mock the registry so we have more control on the"},{"line_number":186,"context_line":"        # classes taken into consideration when calculating the"},{"line_number":187,"context_line":"        # synthethic_fields"},{"line_number":188,"context_line":"        p_registry \u003d mock.patch("},{"line_number":189,"context_line":"            \u0027oslo_versionedobjects.base.VersionedObjectRegistry.obj_classes\u0027,"},{"line_number":190,"context_line":"            return_value\u003d{"},{"line_number":191,"context_line":"                \u0027FakeSmallNeutronObject\u0027: [FakeSmallNeutronObject],"},{"line_number":192,"context_line":"                \u0027FakeWeirdKeySmallNeutronObject\u0027: ["},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"                     FakeWeirdKeySmallNeutronObject]})"},{"line_number":195,"context_line":"        p_registry.start()"},{"line_number":196,"context_line":"        synthetic_obj_fields \u003d self.get_random_fields(FakeSmallNeutronObject)"},{"line_number":197,"context_line":"        self.model_map \u003d {"},{"line_number":198,"context_line":"            self._test_class.db_model: self.db_objs,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_281e52ba","line":195,"range":{"start_line":188,"start_character":8,"end_line":195,"end_character":26},"in_reply_to":"3afc51ec_12a49155","updated":"2016-03-13 22:00:35.000000000","message":"I couldn\u0027t find any fixture for this","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # NOTE(rossella_s): we mock the registry so we have more control on the"},{"line_number":186,"context_line":"        # classes taken into consideration when calculating the"},{"line_number":187,"context_line":"        # synthethic_fields"},{"line_number":188,"context_line":"        p_registry \u003d mock.patch("},{"line_number":189,"context_line":"            \u0027oslo_versionedobjects.base.VersionedObjectRegistry.obj_classes\u0027,"},{"line_number":190,"context_line":"            return_value\u003d{"},{"line_number":191,"context_line":"                \u0027FakeSmallNeutronObject\u0027: [FakeSmallNeutronObject],"},{"line_number":192,"context_line":"                \u0027FakeWeirdKeySmallNeutronObject\u0027: ["},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"                     FakeWeirdKeySmallNeutronObject]})"},{"line_number":195,"context_line":"        p_registry.start()"},{"line_number":196,"context_line":"        synthetic_obj_fields \u003d self.get_random_fields(FakeSmallNeutronObject)"},{"line_number":197,"context_line":"        self.model_map \u003d {"},{"line_number":198,"context_line":"            self._test_class.db_model: self.db_objs,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_12a49155","line":195,"range":{"start_line":188,"start_character":8,"end_line":195,"end_character":26},"in_reply_to":"5aef4532_b2e5130a","updated":"2016-03-11 14:52:51.000000000","message":"not sure, I will look into it later, have to go and want to push this code to get reviews :)","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        mock_calls \u003d []"},{"line_number":260,"context_line":"        # NOTE(rossella_s): since VersionedObjectRegistry is mocked the only"},{"line_number":261,"context_line":"        # class registered is FakeSmallNeutronObject, that is the only one for"},{"line_number":262,"context_line":"        # which the synthethic field is translated"},{"line_number":263,"context_line":"        for db_obj in db_objs:"},{"line_number":264,"context_line":"            for field in self._test_class.synthetic_fields:"},{"line_number":265,"context_line":"                if field \u003d\u003d \u0027shared\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_d2d1bf24","line":262,"range":{"start_line":262,"start_character":26,"end_line":262,"end_character":28},"updated":"2016-03-10 14:05:30.000000000","message":"t","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        mock_calls \u003d []"},{"line_number":260,"context_line":"        # NOTE(rossella_s): since VersionedObjectRegistry is mocked the only"},{"line_number":261,"context_line":"        # class registered is FakeSmallNeutronObject, that is the only one for"},{"line_number":262,"context_line":"        # which the synthethic field is translated"},{"line_number":263,"context_line":"        for db_obj in db_objs:"},{"line_number":264,"context_line":"            for field in self._test_class.synthetic_fields:"},{"line_number":265,"context_line":"                if field \u003d\u003d \u0027shared\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_59548453","line":262,"range":{"start_line":262,"start_character":26,"end_line":262,"end_character":28},"in_reply_to":"5aef4532_d2d1bf24","updated":"2016-03-11 14:52:51.000000000","message":"Done","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        # which the synthethic field is translated"},{"line_number":263,"context_line":"        for db_obj in db_objs:"},{"line_number":264,"context_line":"            for field in self._test_class.synthetic_fields:"},{"line_number":265,"context_line":"                if field \u003d\u003d \u0027shared\u0027:"},{"line_number":266,"context_line":"                    break"},{"line_number":267,"context_line":"                mock_calls.append("},{"line_number":268,"context_line":"                    mock.call("}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_32a743be","line":265,"range":{"start_line":265,"start_character":16,"end_line":265,"end_character":37},"updated":"2016-03-10 14:05:30.000000000","message":"that special casing here suggests something wrong about the code since it\u0027s supposed to be object agnostic.","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"357e8233116c3f6300515cb698cb4faee33aa610","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        # which the synthethic field is translated"},{"line_number":263,"context_line":"        for db_obj in db_objs:"},{"line_number":264,"context_line":"            for field in self._test_class.synthetic_fields:"},{"line_number":265,"context_line":"                if field \u003d\u003d \u0027shared\u0027:"},{"line_number":266,"context_line":"                    break"},{"line_number":267,"context_line":"                mock_calls.append("},{"line_number":268,"context_line":"                    mock.call("}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_7cbb2e0f","line":265,"range":{"start_line":265,"start_character":16,"end_line":265,"end_character":37},"in_reply_to":"5aef4532_32a743be","updated":"2016-03-11 14:52:51.000000000","message":"modified it","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"cbe55e3781cbcf22ba7a33434e5fcd0c2957c634","unresolved":false,"context_lines":[{"line_number":356,"context_line":"                    self.context, self._test_class.db_model, self.db_obj)"},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    def fake_get_objects(self, context, model, **kwargs):"},{"line_number":359,"context_line":"        return self.model_map[model]"},{"line_number":360,"context_line":""},{"line_number":361,"context_line":"    def test_create_updates_from_db_object(self):"},{"line_number":362,"context_line":"        with mock.patch.object(obj_db_api, \u0027create_object\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_528bef1e","line":359,"updated":"2016-03-10 14:05:30.000000000","message":"isn\u0027t it already defined in the base class?","commit_id":"7ff0dad86895371980a23a3254910451a003f1d2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"beb06aa930db984213defa0d49bef8de7fbd8d8a","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        # NOTE(rossella_s): we mock the registry so we have more control on the"},{"line_number":187,"context_line":"        # classes taken into consideration when calculating the"},{"line_number":188,"context_line":"        # synthetic_fields"},{"line_number":189,"context_line":"        p_registry \u003d mock.patch("},{"line_number":190,"context_line":"            \u0027oslo_versionedobjects.base.VersionedObjectRegistry.obj_classes\u0027,"},{"line_number":191,"context_line":"            return_value\u003d{"},{"line_number":192,"context_line":"                \u0027FakeSmallNeutronObject\u0027: [FakeSmallNeutronObject],"}],"source_content_type":"text/x-python","patch_set":5,"id":"3afc51ec_0dcf56b1","line":189,"updated":"2016-03-11 14:55:51.000000000","message":"check Ihar\u0027s comment from previous PS","commit_id":"9bb721ce853043f0ca1e500d92ab127e69c15588"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"cd80288c712a6ee9052baf468fb19ed2c10cd68e","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        # NOTE(rossella_s): we mock the registry so we have more control on the"},{"line_number":187,"context_line":"        # classes taken into consideration when calculating the"},{"line_number":188,"context_line":"        # synthetic_fields"},{"line_number":189,"context_line":"        p_registry \u003d mock.patch("},{"line_number":190,"context_line":"            \u0027oslo_versionedobjects.base.VersionedObjectRegistry.obj_classes\u0027,"},{"line_number":191,"context_line":"            return_value\u003d{"},{"line_number":192,"context_line":"                \u0027FakeSmallNeutronObject\u0027: [FakeSmallNeutronObject],"}],"source_content_type":"text/x-python","patch_set":5,"id":"3afc51ec_28565229","line":189,"in_reply_to":"3afc51ec_0dcf56b1","updated":"2016-03-13 22:33:30.000000000","message":"I need to find a better way to handle this. This class is the base class and it\u0027s inherited . With this code tests would fail for objects that have synthetic field that are meant to be registered, since the registry is mocked here.","commit_id":"9bb721ce853043f0ca1e500d92ab127e69c15588"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"beb06aa930db984213defa0d49bef8de7fbd8d8a","unresolved":false,"context_lines":[{"line_number":225,"context_line":"    def _is_test_class(cls, obj):"},{"line_number":226,"context_line":"        return isinstance(obj, cls._test_class)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def fake_get_objects(self, context, model, **kwargs):"},{"line_number":229,"context_line":"        return self.model_map[model]"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3afc51ec_ede82a19","line":228,"updated":"2016-03-11 14:55:51.000000000","message":"check Ihar\u0027s comment from previous PS","commit_id":"9bb721ce853043f0ca1e500d92ab127e69c15588"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e1690e896a852879f73423ea472bd39502fc9dcc","unresolved":false,"context_lines":[{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def _get_synthetic_fields_get_objects_calls(self, db_objs):"},{"line_number":288,"context_line":"        mock_calls \u003d []"},{"line_number":289,"context_line":"        # NOTE(rossella_s): since VersionedObjectRegistry is mocked the only"},{"line_number":290,"context_line":"        # class registered is FakeSmallNeutronObject, that is the only one for"},{"line_number":291,"context_line":"        # which the synthetic field is translated"},{"line_number":292,"context_line":"        for db_obj in db_objs:"},{"line_number":293,"context_line":"            for field in self._test_class.synthetic_fields:"},{"line_number":294,"context_line":"                if self._test_class.is_object_field(field):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_091468f3","line":291,"range":{"start_line":289,"start_character":8,"end_line":291,"end_character":49},"updated":"2016-03-15 15:31:21.000000000","message":"Is that comment still valid?","commit_id":"56c757dc93b41207a759e22636af085c57cb560b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"2910406c832c1deb77511215ed7955b30527a282","unresolved":false,"context_lines":[{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def _get_synthetic_fields_get_objects_calls(self, db_objs):"},{"line_number":286,"context_line":"        mock_calls \u003d []"},{"line_number":287,"context_line":"        for db_obj in db_objs:"},{"line_number":288,"context_line":"            for field in self._test_class.synthetic_fields:"},{"line_number":289,"context_line":"                if self._test_class.is_object_field(field):"},{"line_number":290,"context_line":"                    mock_calls.append("}],"source_content_type":"text/x-python","patch_set":16,"id":"1af94dfe_4bd588b7","line":287,"updated":"2016-03-16 14:54:53.000000000","message":"(no action required) cascaaaaade ;)","commit_id":"8bccf9c2a5821be606cded7294efa00078bd3e4b"}]}
