)]}'
{"nova/objects/base.py":[{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"efedd4737bd10e83a34dc2b59538ae8bf93c3a25","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    return \u0027_%s\u0027 % name"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def make_class_properties(cls):"},{"line_number":39,"context_line":"    # NOTE(danms/comstud): Inherit fields from super classes."},{"line_number":40,"context_line":"    # mro() returns the current class first and returns \u0027object\u0027 last, so"},{"line_number":41,"context_line":"    # those can be skipped.  Also be careful to not overwrite any fields"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAQn%2F%2FRtA%3D","line":38,"updated":"2013-08-02 18:00:08.000000000","message":"too bad there\u0027s no explicit test for make_class_properties(). Instead we have to test it in a roundabout fashion.","commit_id":"94b555aa4473da1d31a4bdd89329611e4dccf1a0"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"e0a9c01c75923f2d5bd6fd80a7e2d643b4cb9b31","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def make_class_properties(cls):"},{"line_number":39,"context_line":"    # NOTE(danms/comstud): Inherit fields from super classes."},{"line_number":40,"context_line":"    # mro() returns the current class first and returns \u0027object\u0027 last, so"},{"line_number":41,"context_line":"    # those can be skipped.  Also be careful to not overwrite any fields"},{"line_number":42,"context_line":"    # that already exist.  And make sure each cls has its own copy of"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FQBY%3D","line":39,"updated":"2013-08-03 21:27:41.000000000","message":"I agree that adding possibility of inheritance is ok.\n\nBut is there at least one place in current code (or in feature plans) where we actually need this?\n\nP.S. I am mentioning this because we don\u0027t use sqla.Models inheritance.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"d0589e98f04640609e268e78622e2a3d3b78ad20","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def make_class_properties(cls):"},{"line_number":39,"context_line":"    # NOTE(danms/comstud): Inherit fields from super classes."},{"line_number":40,"context_line":"    # mro() returns the current class first and returns \u0027object\u0027 last, so"},{"line_number":41,"context_line":"    # those can be skipped.  Also be careful to not overwrite any fields"},{"line_number":42,"context_line":"    # that already exist.  And make sure each cls has its own copy of"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FOKU%3D","line":39,"in_reply_to":"AAAAQn%2F%2FP%2B0%3D","updated":"2013-08-05 09:13:21.000000000","message":"Thanks for clarifying","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"39d22a52291c8390fac51ecf409910b9484b1f3d","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def make_class_properties(cls):"},{"line_number":39,"context_line":"    # NOTE(danms/comstud): Inherit fields from super classes."},{"line_number":40,"context_line":"    # mro() returns the current class first and returns \u0027object\u0027 last, so"},{"line_number":41,"context_line":"    # those can be skipped.  Also be careful to not overwrite any fields"},{"line_number":42,"context_line":"    # that already exist.  And make sure each cls has its own copy of"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FP%2B0%3D","line":39,"in_reply_to":"AAAAQn%2F%2FQBY%3D","updated":"2013-08-03 22:46:52.000000000","message":"This section of code comes into play for inheriting \u0027created_at\u0027, \u0027deleted_at\u0027, \u0027deleted\u0027, etc.  The old code was actually okay here but was limiting in that it only worked to inherit from the absolute base class... not any intermediate super classes.\n\nThe next patch set in the series splits out those common fields into a separate mix-in class so that we can use objects for both DB-backed and non-DB-backed.  If it\u0027s DB backed, you add the mix-in.  Unfortunately this section of code does not work in that case.  So that\u0027s why it\u0027s being enhanced here.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"966419635f926da1cb8dc12fd9c91221fb82fa99","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    # fields and that it is not sharing the dict with a super class."},{"line_number":44,"context_line":"    cls.fields \u003d dict(cls.fields)"},{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FNxQ%3D","line":46,"updated":"2013-08-05 11:21:49.000000000","message":"This will raise an AttributeError if one of the classes does not have \u0027fields\u0027 (which is a valid situation - no? not all of the super-classes need to be objects)","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"8965c8a826d403a17fa39cadad1ac77068dd6c6d","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    # fields and that it is not sharing the dict with a super class."},{"line_number":44,"context_line":"    cls.fields \u003d dict(cls.fields)"},{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FELo%3D","line":46,"in_reply_to":"AAAAQn%2F%2FJNs%3D","updated":"2013-08-07 17:32:01.000000000","message":"Yup... good point.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"2320aa027ebc6f88896a925d22f718a845172687","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    # fields and that it is not sharing the dict with a super class."},{"line_number":44,"context_line":"    cls.fields \u003d dict(cls.fields)"},{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FJNs%3D","line":46,"in_reply_to":"AAAAQn%2F%2FJOs%3D","updated":"2013-08-06 14:05:22.000000000","message":"For example this will now raise an AttribureError and it shouldn\u0027t:\n\nclass MyObject(NovaObject, MyMixinWithCoolMethods): pass","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"e511a0d68390f419741757991b3330c982eabdd8","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    # fields and that it is not sharing the dict with a super class."},{"line_number":44,"context_line":"    cls.fields \u003d dict(cls.fields)"},{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FJOs%3D","line":46,"in_reply_to":"AAAAQn%2F%2FJSU%3D","updated":"2013-08-06 14:00:34.000000000","message":"So to clarify:\nwe should probably do smth like:\n\nif not issubclass(supercls, NovaObject): pass\nfor field, typefn in supercls.fields.items():\n\nTo avoid an AttributeError when we don\u0027t have the fields class attribute on a random class that we might want to inherit from.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"044dbe21fdd770dd265090c9eae802ed309b54f6","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    # fields and that it is not sharing the dict with a super class."},{"line_number":44,"context_line":"    cls.fields \u003d dict(cls.fields)"},{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FJSU%3D","line":46,"in_reply_to":"AAAAQn%2F%2FNds%3D","updated":"2013-08-06 13:41:59.000000000","message":"because we are expecting to use this code for unified objects, and \"unified objects\" means that we inherit NovaObject.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"afb321169a7bd893eb962cbc93e9bb779c57d145","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    # fields and that it is not sharing the dict with a super class."},{"line_number":44,"context_line":"    cls.fields \u003d dict(cls.fields)"},{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FNds%3D","line":46,"in_reply_to":"AAAAQn%2F%2FNhw%3D","updated":"2013-08-05 13:06:30.000000000","message":"Why would you be so sure? \n\nThere are plenty of valid cases for inheriting from classes other than NovaObject ancestors, and it\u0027s bad practice to invent your own inheritance by special-caseing from which objects we can inherit anyway. Why not let it work in all cases?","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"ff9e1b2723d77a0346d64f3e44fb5d77f504ef9f","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    # fields and that it is not sharing the dict with a super class."},{"line_number":44,"context_line":"    cls.fields \u003d dict(cls.fields)"},{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FNhw%3D","line":46,"in_reply_to":"AAAAQn%2F%2FNxQ%3D","updated":"2013-08-05 12:45:24.000000000","message":"We will use always subclasses of NovaObject -\u003e that already have fields (or in future will contains empty dict of fields) so this will work in any case.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"966419635f926da1cb8dc12fd9c91221fb82fa99","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        def getter(self, name\u003dname):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FNvk%3D","line":48,"updated":"2013-08-05 11:21:49.000000000","message":"Why don\u0027t we allow children to override parents? and if we wanted to do this - we would need to iterate over reversed mro so that classes higher up in the hierarchy come first.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"8965c8a826d403a17fa39cadad1ac77068dd6c6d","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        def getter(self, name\u003dname):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FELs%3D","line":48,"in_reply_to":"AAAAQn%2F%2FNdI%3D","updated":"2013-08-07 17:32:01.000000000","message":"Ya, the code actually does what you would want it to do.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"afb321169a7bd893eb962cbc93e9bb779c57d145","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        def getter(self, name\u003dname):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FNdI%3D","line":48,"in_reply_to":"AAAAQn%2F%2FNgw%3D","updated":"2013-08-05 13:06:30.000000000","message":"Yes actually you are correct - this will work as expected for overriding.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"ff9e1b2723d77a0346d64f3e44fb5d77f504ef9f","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    for supercls in cls.mro()[1:-1]:"},{"line_number":46,"context_line":"        for field, typefn in supercls.fields.items():"},{"line_number":47,"context_line":"            if field not in cls.fields:"},{"line_number":48,"context_line":"                cls.fields[field] \u003d typefn"},{"line_number":49,"context_line":"    for name, typefn in cls.fields.iteritems():"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        def getter(self, name\u003dname):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAQn%2F%2FNgw%3D","line":48,"in_reply_to":"AAAAQn%2F%2FNvk%3D","updated":"2013-08-05 12:45:24.000000000","message":"In situation: \n  class A (object):\n    pass\n\n  class B(A):\n    pass\n\n  class C(A):\n    pass\n\n  class D(B,C): \n    pass\n\n\nin case of D we will iterate [B,C,A] \u003d\u003e to be able to override in B field that is already described in A, we shouldn\u0027t change already existing elements in cls.fileds.","commit_id":"4316936958b57257fa1e956cbbcc5a6b6745ebaf"}]}
