)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7bfaa885addec82025bbcbfbd1a29886594e059d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove common context usage from db model_query()"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Function model_query() from openstack.common.db.sqlalchemy.utils use"},{"line_number":10,"context_line":"is_user_context() function from common context module to indicate, is"},{"line_number":11,"context_line":"the request context is a normal user. But in a different OS projects can"},{"line_number":12,"context_line":"be used different contexts, so this check can be not suitable for same"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5adbc538_d19e4656","line":9,"updated":"2014-05-26 09:12:48.000000000","message":"nit: uses\n\nI\u0027d suggest rephrase these two paragraphs:\n\nCurrently, function model_query() from oslo.db.sqlalchemy.utils uses is_use_context() function in order to determine whether a normal or an admin user request is being processed. But usage of RequestContext is not unified across OpenStack projects, so there is no way for oslo.db to guarantee it processes project_id/deleted filters correctly here.\n\nTo remove this ambiguity, project_id/deleted filters should be passed explicitly instead. At the same time, developers of OpenStack projects are encouraged to provide wrappers for oslo.db model_query() function, so that they could determine the values for project_id/deleted filters depending on how they use RequestContext in their project.","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"d35d5f66984267360cfa7bdd996d05b67749c42d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove common context usage from db model_query()"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Function model_query() from openstack.common.db.sqlalchemy.utils use"},{"line_number":10,"context_line":"is_user_context() function from common context module to indicate, is"},{"line_number":11,"context_line":"the request context is a normal user. But in a different OS projects can"},{"line_number":12,"context_line":"be used different contexts, so this check can be not suitable for same"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5adbc538_9782e950","line":9,"in_reply_to":"5adbc538_d19e4656","updated":"2014-05-26 12:03:59.000000000","message":"ok, let it be","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"e9ee9c4ae1ea96c1029ce03add7cf754f6df2a98","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Function model_query() from openstack.common.db.sqlalchemy.utils use"},{"line_number":10,"context_line":"is_user_context() function from common context module to indicate, is"},{"line_number":11,"context_line":"the request context is a normal user. But in a different OS projects can"},{"line_number":12,"context_line":"be used different contexts, so this check can be not suitable for same"},{"line_number":13,"context_line":"cases. Also it add one more dependency (oslo.context) to oslo.db lib."},{"line_number":14,"context_line":"Similar situation with `read_deleted` option."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7adec928_c806231d","line":11,"updated":"2014-05-15 11:49:20.000000000","message":"s/the request context is a normal user/the request context a normal user/\n\nRedundant \"is\". http://www.englisch-hilfen.de/en/grammar/frage1.htm","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"d35d5f66984267360cfa7bdd996d05b67749c42d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Function model_query() from openstack.common.db.sqlalchemy.utils use"},{"line_number":10,"context_line":"is_user_context() function from common context module to indicate, is"},{"line_number":11,"context_line":"the request context is a normal user. But in a different OS projects can"},{"line_number":12,"context_line":"be used different contexts, so this check can be not suitable for same"},{"line_number":13,"context_line":"cases. Also it add one more dependency (oslo.context) to oslo.db lib."},{"line_number":14,"context_line":"Similar situation with `read_deleted` option."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5adbc538_d7cab1a0","line":11,"in_reply_to":"7adec928_c806231d","updated":"2014-05-26 12:03:59.000000000","message":"refrased","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"}],"oslo/db/sqlalchemy/utils.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7bfaa885addec82025bbcbfbd1a29886594e059d","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    Keyword arguments:"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    :keyword project_id: If present, present, allows filtering by project_id(s)"},{"line_number":202,"context_line":"                         Can be either model.__table__.columns.project_id type,"},{"line_number":203,"context_line":"                         or iterable, or None. If project_id is iterable,"},{"line_number":204,"context_line":"                         filter returns all rows, where `project_id` value in"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_91367e02","line":201,"updated":"2014-05-26 09:12:48.000000000","message":"present? :)","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"d35d5f66984267360cfa7bdd996d05b67749c42d","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    Keyword arguments:"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    :keyword project_id: If present, present, allows filtering by project_id(s)"},{"line_number":202,"context_line":"                         Can be either model.__table__.columns.project_id type,"},{"line_number":203,"context_line":"                         or iterable, or None. If project_id is iterable,"},{"line_number":204,"context_line":"                         filter returns all rows, where `project_id` value in"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_b4bb63c3","line":201,"in_reply_to":"5adbc538_91367e02","updated":"2014-05-26 12:03:59.000000000","message":"lol, fixed :)","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7bfaa885addec82025bbcbfbd1a29886594e059d","unresolved":false,"context_lines":[{"line_number":199,"context_line":"    Keyword arguments:"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    :keyword project_id: If present, present, allows filtering by project_id(s)"},{"line_number":202,"context_line":"                         Can be either model.__table__.columns.project_id type,"},{"line_number":203,"context_line":"                         or iterable, or None. If project_id is iterable,"},{"line_number":204,"context_line":"                         filter returns all rows, where `project_id` value in"},{"line_number":205,"context_line":"                         the project_id list"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_f43970d9","line":202,"updated":"2014-05-26 09:12:48.000000000","message":"Can be either a project_id value, or an iterable of project_id values, or None. If an iterable is passed, only rows whose project_id column value is on the `project_id` list will be returned.\nIf None is passed, only rows which are not bound to any project, will be returned.","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"d35d5f66984267360cfa7bdd996d05b67749c42d","unresolved":false,"context_lines":[{"line_number":199,"context_line":"    Keyword arguments:"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    :keyword project_id: If present, present, allows filtering by project_id(s)"},{"line_number":202,"context_line":"                         Can be either model.__table__.columns.project_id type,"},{"line_number":203,"context_line":"                         or iterable, or None. If project_id is iterable,"},{"line_number":204,"context_line":"                         filter returns all rows, where `project_id` value in"},{"line_number":205,"context_line":"                         the project_id list"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_d4e70fe3","line":202,"in_reply_to":"5adbc538_f43970d9","updated":"2014-05-26 12:03:59.000000000","message":"Done, thanks.","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7bfaa885addec82025bbcbfbd1a29886594e059d","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            _kwargs \u003d {}"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"            if is_user_context(context):"},{"line_number":225,"context_line":"                   _kwargs[project_id] \u003d [context.project_id, None]"},{"line_number":226,"context_line":"            elif \u0027project_id\u0027 in kwargs:"},{"line_number":227,"context_line":"                   _kwargs[\u0027project_id\u0027] \u003d kwargs[\u0027project_id\u0027]"},{"line_number":228,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_d1bba670","line":225,"updated":"2014-05-26 09:12:48.000000000","message":"nit: indent","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"d35d5f66984267360cfa7bdd996d05b67749c42d","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            _kwargs \u003d {}"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"            if is_user_context(context):"},{"line_number":225,"context_line":"                   _kwargs[project_id] \u003d [context.project_id, None]"},{"line_number":226,"context_line":"            elif \u0027project_id\u0027 in kwargs:"},{"line_number":227,"context_line":"                   _kwargs[\u0027project_id\u0027] \u003d kwargs[\u0027project_id\u0027]"},{"line_number":228,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_9412e7b2","line":225,"in_reply_to":"5adbc538_d1bba670","updated":"2014-05-26 12:03:59.000000000","message":"Done","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7bfaa885addec82025bbcbfbd1a29886594e059d","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            if is_user_context(context):"},{"line_number":225,"context_line":"                   _kwargs[project_id] \u003d [context.project_id, None]"},{"line_number":226,"context_line":"            elif \u0027project_id\u0027 in kwargs:"},{"line_number":227,"context_line":"                   _kwargs[\u0027project_id\u0027] \u003d kwargs[\u0027project_id\u0027]"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"            _kwargs[\u0027deleted\u0027] \u003d is_read_deleted("},{"line_number":230,"context_line":"                kwargs.get(read_deleted, False), context):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_31aa0a1a","line":227,"updated":"2014-05-26 09:12:48.000000000","message":"ditto","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"d35d5f66984267360cfa7bdd996d05b67749c42d","unresolved":false,"context_lines":[{"line_number":224,"context_line":"            if is_user_context(context):"},{"line_number":225,"context_line":"                   _kwargs[project_id] \u003d [context.project_id, None]"},{"line_number":226,"context_line":"            elif \u0027project_id\u0027 in kwargs:"},{"line_number":227,"context_line":"                   _kwargs[\u0027project_id\u0027] \u003d kwargs[\u0027project_id\u0027]"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"            _kwargs[\u0027deleted\u0027] \u003d is_read_deleted("},{"line_number":230,"context_line":"                kwargs.get(read_deleted, False), context):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_b417e3a2","line":227,"in_reply_to":"5adbc538_31aa0a1a","updated":"2014-05-26 12:03:59.000000000","message":"Done","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7bfaa885addec82025bbcbfbd1a29886594e059d","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                   _kwargs[\u0027project_id\u0027] \u003d kwargs[\u0027project_id\u0027]"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"            _kwargs[\u0027deleted\u0027] \u003d is_read_deleted("},{"line_number":230,"context_line":"                kwargs.get(read_deleted, False), context):"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"            return utils.model_query(*args, **_kwargs)"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_f176e2d7","line":230,"updated":"2014-05-26 09:12:48.000000000","message":"nit: \u0027read_deleted\u0027","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"d35d5f66984267360cfa7bdd996d05b67749c42d","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                   _kwargs[\u0027project_id\u0027] \u003d kwargs[\u0027project_id\u0027]"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"            _kwargs[\u0027deleted\u0027] \u003d is_read_deleted("},{"line_number":230,"context_line":"                kwargs.get(read_deleted, False), context):"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"            return utils.model_query(*args, **_kwargs)"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_97ff4901","line":230,"in_reply_to":"5adbc538_f176e2d7","updated":"2014-05-26 12:03:59.000000000","message":"Done","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7bfaa885addec82025bbcbfbd1a29886594e059d","unresolved":false,"context_lines":[{"line_number":232,"context_line":"            return utils.model_query(*args, **_kwargs)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        result \u003d (model_query(context, models.Instance, session\u003dsession)"},{"line_number":236,"context_line":"                       .filter_by(uuid\u003dinstance_uuid)"},{"line_number":237,"context_line":"                       .all())"},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_31584a56","line":235,"updated":"2014-05-26 09:12:48.000000000","message":"context? :)","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"d35d5f66984267360cfa7bdd996d05b67749c42d","unresolved":false,"context_lines":[{"line_number":232,"context_line":"            return utils.model_query(*args, **_kwargs)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        result \u003d (model_query(context, models.Instance, session\u003dsession)"},{"line_number":236,"context_line":"                       .filter_by(uuid\u003dinstance_uuid)"},{"line_number":237,"context_line":"                       .all())"},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_b7044516","line":235,"in_reply_to":"5adbc538_31584a56","updated":"2014-05-26 12:03:59.000000000","message":"Done","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7bfaa885addec82025bbcbfbd1a29886594e059d","unresolved":false,"context_lines":[{"line_number":238,"context_line":""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        query \u003d model_query("},{"line_number":241,"context_line":"                    context, Node,"},{"line_number":242,"context_line":"                    session\u003dsession,"},{"line_number":243,"context_line":"                    args\u003d(func.count(Node.id), func.sum(Node.ram))"},{"line_number":244,"context_line":"                    ).filter_by(uuid\u003dnode_uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_5155d61b","line":241,"updated":"2014-05-26 09:12:48.000000000","message":"ditto","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"d35d5f66984267360cfa7bdd996d05b67749c42d","unresolved":false,"context_lines":[{"line_number":238,"context_line":""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        query \u003d model_query("},{"line_number":241,"context_line":"                    context, Node,"},{"line_number":242,"context_line":"                    session\u003dsession,"},{"line_number":243,"context_line":"                    args\u003d(func.count(Node.id), func.sum(Node.ram))"},{"line_number":244,"context_line":"                    ).filter_by(uuid\u003dnode_uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5adbc538_d709d12d","line":241,"in_reply_to":"5adbc538_5155d61b","updated":"2014-05-26 12:03:59.000000000","message":"Done","commit_id":"dc4c006a1da3e75c9b125b3af6def0a10b4c74f3"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"1347a125837866eef3ea6872d825d69acceb79b9","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        raise ValueError(_(\"There is no `project_id` column in `%s` table.\")"},{"line_number":175,"context_line":"                         % db_model.__name__)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    if isinstance(project_id, (list, tuple, set)):"},{"line_number":178,"context_line":"        query \u003d query.filter(db_model.project_id.in_(project_id))"},{"line_number":179,"context_line":"    else:"},{"line_number":180,"context_line":"        query \u003d query.filter(db_model.project_id \u003d\u003d project_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_80d37d37","line":177,"updated":"2014-05-30 15:36:38.000000000","message":"Ah, this is required to support the allow_none case from before.  I was all ready to object because it looks like new functionality. :-)","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"93ee7f216174a8ec85061cfce9fa1ea8d277463c","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        raise ValueError(_(\"There is no `project_id` column in `%s` table.\")"},{"line_number":175,"context_line":"                         % db_model.__name__)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    if isinstance(project_id, (list, tuple, set)):"},{"line_number":178,"context_line":"        query \u003d query.filter(db_model.project_id.in_(project_id))"},{"line_number":179,"context_line":"    else:"},{"line_number":180,"context_line":"        query \u003d query.filter(db_model.project_id \u003d\u003d project_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_0103c142","line":177,"in_reply_to":"1ae5cdf2_80d37d37","updated":"2014-06-02 11:00:11.000000000","message":"yes, we suppose, to work list with list of project_id\u0027s instead of ``allow_none`` parameter.","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"1347a125837866eef3ea6872d825d69acceb79b9","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    return query"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"def model_query(model, session, args\u003dNone, **kwargs):"},{"line_number":186,"context_line":"    \"\"\"Query helper for db.sqlalchemy api methods."},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    This accounts for `deleted` and `project_id` fields."}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_20ad4932","line":185,"updated":"2014-05-30 15:36:38.000000000","message":"I\u0027m wondering if there would be any value in checking for the presence of the old kwargs and logging a message in case someone misses updating one of their model_query calls.  Maybe that\u0027s not something that can really happen since we removed the context param though?  Just wanted to mention it since we\u0027ve had issues in the past when we change a function prototype like this. :-)","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"93ee7f216174a8ec85061cfce9fa1ea8d277463c","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    return query"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"def model_query(model, session, args\u003dNone, **kwargs):"},{"line_number":186,"context_line":"    \"\"\"Query helper for db.sqlalchemy api methods."},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    This accounts for `deleted` and `project_id` fields."}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_c591e49b","line":185,"in_reply_to":"1ae5cdf2_20ad4932","updated":"2014-06-02 11:00:11.000000000","message":"at the moment function model_query() do not in use in any OS project. So I suppose, that this change will not cause a such issues.","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"1347a125837866eef3ea6872d825d69acceb79b9","unresolved":false,"context_lines":[{"line_number":215,"context_line":"    :type deleted:       bool"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    Usage:"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    .. code-block:: python"},{"line_number":221,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_809b7dc8","line":218,"updated":"2014-05-30 15:36:38.000000000","message":"It would be nice in the usage section if we could include some information about writing the wrapper you mentioned in the commit message.  It doesn\u0027t seem like either of the examples below include the new kwargs.","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"93ee7f216174a8ec85061cfce9fa1ea8d277463c","unresolved":false,"context_lines":[{"line_number":215,"context_line":"    :type deleted:       bool"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    Usage:"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    .. code-block:: python"},{"line_number":221,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_48ede924","line":218,"in_reply_to":"1ae5cdf2_809b7dc8","updated":"2014-06-02 11:00:11.000000000","message":"Done","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"1347a125837866eef3ea6872d825d69acceb79b9","unresolved":false,"context_lines":[{"line_number":222,"context_line":"      from oslo.db.sqlalchemy import utils"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"      def get_istance_by_uuid():"},{"line_number":226,"context_line":"          session \u003d get_session()"},{"line_number":227,"context_line":"          with session.begin()"},{"line_number":228,"context_line":"              return (utils.model_query(models.Instance, session\u003dsession)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_25ad5b32","line":225,"updated":"2014-05-30 15:36:38.000000000","message":"*instance","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"93ee7f216174a8ec85061cfce9fa1ea8d277463c","unresolved":false,"context_lines":[{"line_number":222,"context_line":"      from oslo.db.sqlalchemy import utils"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"      def get_istance_by_uuid():"},{"line_number":226,"context_line":"          session \u003d get_session()"},{"line_number":227,"context_line":"          with session.begin()"},{"line_number":228,"context_line":"              return (utils.model_query(models.Instance, session\u003dsession)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_4bfde839","line":225,"in_reply_to":"1ae5cdf2_25ad5b32","updated":"2014-06-02 11:00:11.000000000","message":"Done","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"32d1c07f465d9711bfae469015ac464fbb918e5b","unresolved":false,"context_lines":[{"line_number":237,"context_line":"              return utils.model_query(Node, session\u003dsession, args\u003ddata).all()"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    Also you can create your own helper, based on ``utils.model_query()``."},{"line_number":240,"context_line":"    For example, it can be useful if you suppose to use ``project_id`` and"},{"line_number":241,"context_line":"    ``deleted`` parameters from project\u0027s ``context``"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    .. code-block:: python"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_f4d68cf0","line":240,"updated":"2014-06-02 11:38:34.000000000","message":"s/suppose/plan","commit_id":"16f7c25d49f42d55a4f095d1287135dc850fc2ac"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"9f938ac35979466e19ac234b80897635b0d40dc2","unresolved":false,"context_lines":[{"line_number":237,"context_line":"              return utils.model_query(Node, session\u003dsession, args\u003ddata).all()"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    Also you can create your own helper, based on ``utils.model_query()``."},{"line_number":240,"context_line":"    For example, it can be useful if you suppose to use ``project_id`` and"},{"line_number":241,"context_line":"    ``deleted`` parameters from project\u0027s ``context``"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    .. code-block:: python"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_5f103901","line":240,"in_reply_to":"1ae5cdf2_f4d68cf0","updated":"2014-06-02 11:56:51.000000000","message":"Done","commit_id":"16f7c25d49f42d55a4f095d1287135dc850fc2ac"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"32d1c07f465d9711bfae469015ac464fbb918e5b","unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":"          project_id \u003d _get_project_id(context, project_id, project_only)"},{"line_number":252,"context_line":"          deleted \u003d _get_deleted(context, read_deleted)"},{"line_number":253,"context_line":"          session \u003d get_session()"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"          with session.begin():"},{"line_number":256,"context_line":"              return utils.model_query(model, session\u003dsession, args\u003dargs,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_3499d41f","line":253,"updated":"2014-06-02 11:38:34.000000000","message":"As handling of session is already done in model_query(), perhaps we should just take it as an argument in this helper?","commit_id":"16f7c25d49f42d55a4f095d1287135dc850fc2ac"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"9f938ac35979466e19ac234b80897635b0d40dc2","unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":"          project_id \u003d _get_project_id(context, project_id, project_only)"},{"line_number":252,"context_line":"          deleted \u003d _get_deleted(context, read_deleted)"},{"line_number":253,"context_line":"          session \u003d get_session()"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"          with session.begin():"},{"line_number":256,"context_line":"              return utils.model_query(model, session\u003dsession, args\u003dargs,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_ffb90516","line":253,"in_reply_to":"1ae5cdf2_14193888","updated":"2014-06-02 11:56:51.000000000","message":"Done","commit_id":"16f7c25d49f42d55a4f095d1287135dc850fc2ac"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"8af4065a54633a14e4e35889efada192ce0747da","unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":"          project_id \u003d _get_project_id(context, project_id, project_only)"},{"line_number":252,"context_line":"          deleted \u003d _get_deleted(context, read_deleted)"},{"line_number":253,"context_line":"          session \u003d get_session()"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"          with session.begin():"},{"line_number":256,"context_line":"              return utils.model_query(model, session\u003dsession, args\u003dargs,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_14193888","line":253,"in_reply_to":"1ae5cdf2_3499d41f","updated":"2014-06-02 11:43:17.000000000","message":"Oh, we\u0027ve removed that. Ok, can we take it as an optional argument in this helper and create a new Session on demand then?","commit_id":"16f7c25d49f42d55a4f095d1287135dc850fc2ac"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"b9d3da16516773d104ece24d256d911f6a9d3511","unresolved":false,"context_lines":[{"line_number":253,"context_line":"          # ``_get_deleted()`` should handle passed parameters and"},{"line_number":254,"context_line":"          # context object (for example, decide, if we need to restrict a user"},{"line_number":255,"context_line":"          # to query his own entries by project_id or only allow admin to read"},{"line_number":256,"context_line":"          # deleted entries). As a returned values we suppose to get"},{"line_number":257,"context_line":"          # ``project_id`` and ``deleted``, which are suitable for the"},{"line_number":258,"context_line":"          # ``model_query()`` signature."},{"line_number":259,"context_line":"          kwargs \u003d {}"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_e4292238","line":256,"updated":"2014-06-04 14:46:26.000000000","message":"Grammar nit: I think this should be \"For return values, we expect to get...\"","commit_id":"5d11f97a2ee755ccf63f2df441d248a5d1a227d4"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"a21a440dcb190726dad1fb9740c2e9a36f384e03","unresolved":false,"context_lines":[{"line_number":253,"context_line":"          # ``_get_deleted()`` should handle passed parameters and"},{"line_number":254,"context_line":"          # context object (for example, decide, if we need to restrict a user"},{"line_number":255,"context_line":"          # to query his own entries by project_id or only allow admin to read"},{"line_number":256,"context_line":"          # deleted entries). As a returned values we suppose to get"},{"line_number":257,"context_line":"          # ``project_id`` and ``deleted``, which are suitable for the"},{"line_number":258,"context_line":"          # ``model_query()`` signature."},{"line_number":259,"context_line":"          kwargs \u003d {}"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_648ef2d1","line":256,"in_reply_to":"1ae5cdf2_e4292238","updated":"2014-06-04 14:55:42.000000000","message":"/me is not native speaker :)\n\nDone.","commit_id":"5d11f97a2ee755ccf63f2df441d248a5d1a227d4"}],"tests/sqlalchemy/test_utils.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"1347a125837866eef3ea6872d825d69acceb79b9","unresolved":false,"context_lines":[{"line_number":765,"context_line":"        utils.model_query(MyModelSoftDeleted, session\u003dself.session)"},{"line_number":766,"context_line":"        self.assertEqual(_read_deleted_filter.call_count, 0)"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_project_only_true(self):"},{"line_number":769,"context_line":"        project_id \u003d 10"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":"        mock_query \u003d utils.model_query("}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_8079bdfe","line":768,"updated":"2014-05-30 15:36:38.000000000","message":"Nit: This test name doesn\u0027t really make sense now.","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"93ee7f216174a8ec85061cfce9fa1ea8d277463c","unresolved":false,"context_lines":[{"line_number":765,"context_line":"        utils.model_query(MyModelSoftDeleted, session\u003dself.session)"},{"line_number":766,"context_line":"        self.assertEqual(_read_deleted_filter.call_count, 0)"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_project_only_true(self):"},{"line_number":769,"context_line":"        project_id \u003d 10"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":"        mock_query \u003d utils.model_query("}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_a8a3cd9c","line":768,"in_reply_to":"1ae5cdf2_8079bdfe","updated":"2014-06-02 11:00:11.000000000","message":"renamed","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"1347a125837866eef3ea6872d825d69acceb79b9","unresolved":false,"context_lines":[{"line_number":795,"context_line":"        )"},{"line_number":796,"context_line":""},{"line_number":797,"context_line":"    @mock.patch.object(utils, \"_read_deleted_filter\")"},{"line_number":798,"context_line":"    def test_context_show_deleted(self, _read_deleted_filter):"},{"line_number":799,"context_line":"        _read_deleted_filter.return_value \u003d self.session.query"},{"line_number":800,"context_line":"        utils.model_query(MyModel, deleted\u003dTrue,"},{"line_number":801,"context_line":"                          args\u003d(MyModel.id,), session\u003dself.session)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_7bff0002","line":798,"updated":"2014-05-30 15:36:38.000000000","message":"We removed the context stuff, do we even still need this test?  It looks like it was just testing that we supported both read_deleted and show_deleted, which isn\u0027t necessary anymore.","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"93ee7f216174a8ec85061cfce9fa1ea8d277463c","unresolved":false,"context_lines":[{"line_number":795,"context_line":"        )"},{"line_number":796,"context_line":""},{"line_number":797,"context_line":"    @mock.patch.object(utils, \"_read_deleted_filter\")"},{"line_number":798,"context_line":"    def test_context_show_deleted(self, _read_deleted_filter):"},{"line_number":799,"context_line":"        _read_deleted_filter.return_value \u003d self.session.query"},{"line_number":800,"context_line":"        utils.model_query(MyModel, deleted\u003dTrue,"},{"line_number":801,"context_line":"                          args\u003d(MyModel.id,), session\u003dself.session)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_48ba49c1","line":798,"in_reply_to":"1ae5cdf2_7bff0002","updated":"2014-06-02 11:00:11.000000000","message":"Agree, thanks","commit_id":"c3f87b1830326fb7bfa32b441a33ddbf8fcd149b"}]}
