{"action":"closed","issue":{"url":"https://api.github.com/repos/d1ffuz0r/sqlalchemy-manager/issues/3","repository_url":"https://api.github.com/repos/d1ffuz0r/sqlalchemy-manager","labels_url":"https://api.github.com/repos/d1ffuz0r/sqlalchemy-manager/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/d1ffuz0r/sqlalchemy-manager/issues/3/comments","events_url":"https://api.github.com/repos/d1ffuz0r/sqlalchemy-manager/issues/3/events","html_url":"https://github.com/d1ffuz0r/sqlalchemy-manager/issues/3","id":369817647,"node_id":"MDU6SXNzdWUzNjk4MTc2NDc=","number":3,"title":"Проблемы с Query объектом в запросе","user":{"login":"pablodiguerero","id":4044346,"node_id":"MDQ6VXNlcjQwNDQzNDY=","avatar_url":"https://avatars0.githubusercontent.com/u/4044346?v=4","gravatar_id":"","url":"https://api.github.com/users/pablodiguerero","html_url":"https://github.com/pablodiguerero","followers_url":"https://api.github.com/users/pablodiguerero/followers","following_url":"https://api.github.com/users/pablodiguerero/following{/other_user}","gists_url":"https://api.github.com/users/pablodiguerero/gists{/gist_id}","starred_url":"https://api.github.com/users/pablodiguerero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pablodiguerero/subscriptions","organizations_url":"https://api.github.com/users/pablodiguerero/orgs","repos_url":"https://api.github.com/users/pablodiguerero/repos","events_url":"https://api.github.com/users/pablodiguerero/events{/privacy}","received_events_url":"https://api.github.com/users/pablodiguerero/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-13T16:26:29Z","updated_at":"2018-10-13T20:42:50Z","closed_at":"2018-10-13T20:42:50Z","author_association":"NONE","body":"Класс менеджера\r\n\r\n```python\r\nclass RealtyManager(DataTableManager):\r\n\r\n    @staticmethod\r\n    def with_author(query):\r\n        from models.realty.realty import Realty\r\n\r\n        q = query.filter(Realty.author_id == 1)\r\n        return q\r\n\r\n    @staticmethod\r\n    def with_id(query):\r\n        q = query.filter_by(id=1)\r\n        return q\r\n```\r\n\r\nORM модель\r\n\r\n```python\r\nclass Realty(db.Model, LoggableMixin):\r\n    # ...\r\n    __manager__ = RealtyManager\r\n```\r\n\r\nИсполняемый код\r\n\r\n```python\r\nq = Realty.query.filter(sa.and_(*search_filter))\r\nprint(q._criterion)\r\nq1 = q.filter(Realty.id == 1)\r\nprint(q1._criterion)\r\nq2 = q1.with_id()\r\nprint(q2._criterion)\r\nq3 = q2.with_author()\r\nprint(q3._criterion)\r\n```\r\n\r\nВывод в консоли\r\n\r\n```bash\r\ncrm_realty_flat.market_type_id = :market_type_id_1\r\ncrm_realty_flat.market_type_id = :market_type_id_1 AND crm_realty.id = :id_1\r\ncrm_realty.id = :id_1\r\ncrm_realty.author_id = :author_id_1\r\n```\r\n\r\nОни же должны сохраняться?"}}
{"actor":{"display_login":"pablodiguerero"}}